PHP SMTPメール機能がphpmailerで動作せず、次のエラーがスローされる
エラー: SMTP エラー: 言語文字列の読み込みに失敗しました: tls.
私のコードは:
require_once('class.phpmailer.php');
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = True; // enable SMTP authentication
$mail->SMTPSecure = "tls"; // sets the prefix to the server
$mail->Host = "localhost";
$mail->Port = 25;
$mail->Username = "xxxxxx@xxxxx.org.in"; // my username
$mail->Password = "xxxx"; // my password
$mail->From = "xxxxxxx@xxxxx.org.in";
$mail->FromName = "you name";
$mail->Subject = "some subject";
$mail->MsgHTML("the message");
$mail->AddAddress("yyyyyy@gmail.com","logan");
$mail->IsHTML(true); // send as HTML
if(!$mail->Send()) {//to see if we return a message or a value bolean
echo "Mailer Error: " . $mail->ErrorInfo;
} else echo "Message sent!";
Web サービス プロバイダーのホストとポートの詳細を取得しましたが、機能していません。
デバッグすると、次のエラーが表示されます。
SMTP -> FROM SERVER:220 We do not authorize the use of this system to transport unsolicited, and/or bulk e-mail.
SMTP -> FROM SERVER: 250-mail02.clientns.net [127.0.0.1], this server offers 4 extensions 250-AUTH LOGIN 250-SIZE 52428800 250-HELP 250 AUTH=LOGIN
SMTP -> FROM SERVER:503 Bad sequence of commands
SMTP -> ERROR: STARTTLS not accepted from server: 503 Bad sequence of commands
SMTP -> FROM SERVER:250 Requested mail action okay, completed
Language string failed to load: tls Mailer Error: Language string failed to load: tls
接続できない理由を教えてください。