【发布时间】:2017-10-09 10:38:13
【问题描述】:
我在尝试通过 telnet 登录我的电子邮件服务器时收到 504 错误。我试过 25 和 587 端口。(用 *s 和 xs 屏蔽域和 ips)。
>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]
虽然我可以使用 phpmailer 做到这一点!:
<?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();
在身份验证的背后,它正在做的事情:
public function Authenticate($username, $password) {
// Start authentication
fputs($this->smtp_conn,"AUTH LOGIN" . $this->CRLF);
//...
我怎样才能在命令行上运行它?
【问题讨论】:
标签: php smtp phpmailer telnet smtp-auth