我已经安装了电子邮件包并尝试发送测试邮件,但它向我显示以下错误:AuthError:无效登录 - 535-5.7.8 用户名和密码不被接受
我确信凭据是正确的,并且代码与以下内容相同:https://github.com/ideaq/meteor-email https://github.com/ideaq/meteor-email
/服务器/init.js
process.env.MAIL_URL="smtp://USERNAME%40gmail.com:[email protected] /cdn-cgi/l/email-protection:465/";
console.log(process.env.MAIL_URL);
Email.send({
from: "[email protected] /cdn-cgi/l/email-protection",
to: "[email protected] /cdn-cgi/l/email-protection",
subject: "Meteor Can Send Emails via Gmail",
text: "test"
});
还尝试过:
// configure email later for validation and sending messages
smtp = {
username: '[email protected] /cdn-cgi/l/email-protection',
password: 'my-pw',
server: 'smtp.gmail.com',
port: 465
};
process.env.MAIL_URL = 'smtp://' + encodeURIComponent(smtp.username) + ':' + encodeURIComponent(smtp.password) + '@' + encodeURIComponent(smtp.server) + ':' + smtp.port;
我似乎找不到有关此问题或如何跟进的任何其他信息。谁能给我一个线索?
谢谢大家的建议!我通过实际打开两步验证、生成应用程序密码并使用它作为登录来修复它。奇怪的解决方案,但它有效!
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)