流星:发邮件| AuthError:无效登录 - 535-5.7.8 [英] meteor: send email | AuthError: Invalid login - 535-5.7.8

查看:1046
本文介绍了流星:发邮件| AuthError:无效登录 - 535-5.7.8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了电子邮件包,并尝试发送测试邮件,但它显示以下错误: AuthError:无效登录 - 535-5.7.8用户名和密码不被接受 / p>

我确信凭据正确,代码与以下内容相同: https://github.com/ideaq/meteor-email



/server/init.js

  process.env.MAIL_URL =smtp://USERNAME%40gmail.com:PASSWORD@smtp.gmail.com:465 /; 
console.log(process.env.MAIL_URL);

Email.send({
from:from@gmail.com,
to:my-email@gmail.com,
主题: Meteor可以通过Gmail发送电子邮件,
文本:test
});

还试过:

  //稍后配置电子邮件验证和发送消息
smtp = {
username:'myusername@gmail.com',
密码:'my-pw',
server:'smtp.gmail.com',
port:465
};

process.env.MAIL_URL ='smtp://'+ encodeURIComponent(smtp.username)+':'+ encodeURIComponent(smtp.password)+'@'+ encodeURIComponent(smtp.server)+ ':'+ smtp.port;

我似乎找不到有关此问题的任何其他信息或如何跟进。谁能给我一个线索?

解决方案

thx的建议!我通过实际打开两步验证来修复它,生成一个应用程序密码,并将其用作登录。奇怪的解决方案,但它工作!


I've installed the email package and tried to sent a test mail, but it presents me with the following error: AuthError: Invalid login - 535-5.7.8 Username and Password not accepted

I'm sure the credentials are correct and the code is the same as: https://github.com/ideaq/meteor-email

/server/init.js

process.env.MAIL_URL="smtp://USERNAME%40gmail.com:PASSWORD@smtp.gmail.com:465/";
console.log(process.env.MAIL_URL);

Email.send({
    from: "from@gmail.com",
    to: "my-email@gmail.com",
    subject: "Meteor Can Send Emails via Gmail",
    text: "test"
});

also tried:

// configure email later for validation and sending messages
smtp = {
    username: 'myusername@gmail.com',
    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;

I can't seem to find any other information around this problem or how to followup on it. Who can give me a clue?

解决方案

thx for the suggestions guys! I fixed it by actually turning ON 2-step verification, generate an app password and use THAT as login. Strange solution, but it worked!

这篇关于流星:发邮件| AuthError:无效登录 - 535-5.7.8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆