2017-05-10 18 views
0

telnetでメールサーバーにログインしようとすると504エラーが表示されます。私はポート25と587を試しました。(ドメインとipsを* sとxsでマスキングする)はtelnetエラーでsmtpサーバーに接続できません504

public function Authenticate($username, $password) { 
    // Start authentication 
    fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF); 
    //... 

は、どのように私はこれに取り組んで取得できます。

>EHLO domain.com 
250-************.outlook.office365.com Hello [xx.xx.xx.xx] 
250-SIZE 157286400 
250-PIPELINING 
250-DSN 
250-ENHANCEDSTATUSCODES 
250-STARTTLS 
250-8BITMIME 
250-BINARYMIME 
250 CHUNKING 
> HELP 
214-This server supports the following commands: 
214 HELO EHLO STARTTLS RCPT DATA RSET MAIL QUIT HELP AUTH BDAT 
> AUTH 
504 5.7.4 Unrecognized authentication type 
[*************.********.****.outlook.com] 
> auth 
504 5.7.4 Unrecognized authentication type 
[*************.********.****.outlook.com] 
> AUTH LOGIN 
504 5.7.4 Unrecognized authentication type 
[*************.********.****.outlook.com] 
> auth login 
504 5.7.4 Unrecognized authentication type 
[*************.********.****.outlook.com] 

私はそれをやっているAUTHため

 <?php 
     $mail = new PHPMailer(true); 
     $mail->IsSMTP(); 
     $mail->Host = $host; 
     $mail->Port = 587; 
     $mail->SMTPDebug = 2; 
     $mail->SMTPSecure = "tls"; 
     $mail->SMTPAuth = true; 
     $mail->Username = $user; 
     $mail->Password = $password; 
     $mail->SetFrom($user, "chiliNUT"); 
     $mail->Subject = $subject; 
     $mail->MsgHTML($content); 
     $mail->send(); 

そして、ボンネットの下に!:かかわらphpmailerのを使ってうまくそれを行うことができますコマンドライン?

答えて

1

ほとんどの賢明なメールサーバーでは暗号化されていないAUTHが許可されていないからです。サーバーから受け取った機能リストにはAUTHが含まれていませんので、PHPMailerは自動的にSTARTTLSを呼び出す必要があります。これを手動でtelnetで簡単に行うことはできません。それをより良くするにはopensslのs_clientコマンドを使用してください。 PHPMailerのトラブルシューティングガイドには、次のような例があります。

openssl s_client -starttls smtp -connect smtp.outlook.office365.com:587 
+0

ありがとうございました! – chiliNUT

関連する問題