STMP.JS没有发送电子邮件,我做错了什么吗?
我正在尝试从我的客户端JavaScript发送电子邮件,但是该功能不会发送电子邮件。我不知道我在做什么错,还是Gmail禁用该功能?这是我的代码
function sendEmail() {
Email.send({
Host: "smtp.gmail.com",
Username: "[email protected]",
Password: "password",
To: "recepientemail",
From: "[email protected]",
Subject: "Subject",
Body: "Hooray",
})
.then(function (message) {
console.log("mail sent successfully")
});
}
I am trying to send emails from my client-side javascript however the function does not send the email. I do not know what I am doing wrong yet or is the feature disabled from Gmail? Here is my code
function sendEmail() {
Email.send({
Host: "smtp.gmail.com",
Username: "[email protected]",
Password: "password",
To: "recepientemail",
From: "[email protected]",
Subject: "Subject",
Body: "Hooray",
})
.then(function (message) {
console.log("mail sent successfully")
});
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须允许访问较不安全的应用程序在您的gmail设置中(此选项将在5月30日可用2022)
You have to allow access to less secure apps in your gmail settings (This option will be available till 30th May 2022)