2016-05-24 18 views
2

私はPHP経由でメールを送信したいので、私はPHPMailerを使用しています。なぜこのエラーが出るのか分かりません。メーラーエラー:SMTPエラー:データが受け付けられません

Mailer Error: SMTP Error: data not accepted.SMTP server error: DATA END command failed Detail: Relaying not allowed - sender domain not local SMTP code: 530

これは私のコードです。

require '../library/PHPMailer/PHPMailerAutoload.php'; 
$mail = new PHPMailer; 
$mail->IsSMTP(); 
//From email address and name 
$mail->From = "[email protected]"; 
$mail->FromName = "Full Name"; 

//To address and name 
$mail->addAddress("[email protected]", "Recipient Name"); 
//$mail->addAddress("[email protected]"); //Recipient name is  optional 

//Address to which recipient will reply 
$mail->addReplyTo("[email protected]", "Reply"); 



//Send HTML or Plain Text email 
$mail->isHTML(true); 

$mail->Subject = "Subject Text"; 
$mail->Body = "<i>Mail body in HTML</i>"; 
//$mail->AltBody = "This is the plain text version of the email content"; 

if(!$mail->send()) 
{ 
    echo "Mailer Error: " . $mail->ErrorInfo; 
} 
else 
{ 
    echo "Message has been sent successfully"; 
} 

ご意見やご提案はありますか?私はローカルでこのコードを実行していない、それはサーバー上にある。

答えて

1

サーバーが認証なしで送信することは珍しいことです。 PHPMailerで提供されている例として、Host、SMTPAuth、Username、およびPasswordの各プロパティを設定することをお勧めします。

関連する問題