我正在使用 Erlang 及其 esmtp 库从我的应用程序发送电子邮件。它以前运行正常,现在在开发机器上仍然运行良好。不幸的是,几周前它在生产服务器上停止工作了。我在日志中收到以下消息:
2016-02-08 00:19:40.281 [debug] <0.676.0>@esmtp_sock:connect:33 SMTP: connect to "smtp.googlemail.com":465, ssl
2016-02-08 00:19:40.393 [debug] <0.676.0>@esmtp_sock:connect:36 SMTP: connected on socket {sslsocket,{gen_tcp,#Port<0.11477>,tls_connection,undefined},<0.678.0>}
2016-02-08 00:19:40.434 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"220 smtp.googlemail.com ESMTP yz5sm27006239wjc.36 - gsmtp\r\n">>
2016-02-08 00:19:40.434 [debug] <0.676.0>@esmtp_sock:send:72 SMTP: send [[<<"EHLO ">>,"relay.example.com"],13,10]
2016-02-08 00:19:40.455 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-smtp.googlemail.com at your service, [<SERVER-IP-ADDRESS>]\r\n">>
2016-02-08 00:19:40.455 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-SIZE 35882577\r\n">>
2016-02-08 00:19:40.455 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-8BITMIME\r\n">>
2016-02-08 00:19:40.455 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-AUTH LOGIN PLAIN XOAUTH2 PLAIN-CLIENTTOKEN OAUTHBEARER XOAUTH\r\n">>
2016-02-08 00:19:40.455 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-ENHANCEDSTATUSCODES\r\n">>
2016-02-08 00:19:40.456 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-PIPELINING\r\n">>
2016-02-08 00:19:40.456 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250-CHUNKING\r\n">>
2016-02-08 00:19:40.456 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"250 SMTPUTF8\r\n">>
2016-02-08 00:19:40.456 [debug] <0.676.0>@esmtp_sock:send:72 SMTP: send [[<<"AUTH ">>,"PLAIN"],13,10]
2016-02-08 00:19:40.474 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"334 \r\n">>
2016-02-08 00:19:40.474 [debug] <0.676.0>@esmtp_sock:send:72 SMTP: send [[<<"BASE64-ENCODED-CREDENTIALS">>],13,10]
2016-02-08 00:19:40.613 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"535-5.7.8 Username and Password not accepted. Learn more at\r\n">>
2016-02-08 00:19:40.613 [debug] <0.676.0>@esmtp_sock:read_response:46 SMTP: response line: <<"535 5.7.8 https://support.google.com/mail/answer/14257 yz5sm27006239wjc.36 - gsmtp\r\n">>
来自开发机器的日志完全相同。编码的凭据字符串也是如此!我已将电子邮件帐户的“允许安全性较低的应用程序”设置为“开”。请帮忙!谢谢。