![](/img/trans.png)
[英]SmtpJS not working with Elastic Email: "Failure sending mail. The server must be configured corectly."
[英]Problem sending email through stmpjs and elastic mail
我正在尝试通过我的节点 JS 应用程序发送一封电子邮件,并且我的一个页面中有这个脚本。
<script src="https://smtpjs.com/v3/smtp.js"></script>
<script>
function sendEmail(){console.log(Email)
Email.send({
SecureToken:'#########',
To: `mymail@gmail.com`,
From: "info@example.com",
Subject: "Hello world",
Body: `Lorem ipsum dolor sit amet`
}).then(response => {
alert(response)
});
}
</script>
<button onclick="sendEmail()">Send email</button>
我得到了回复 OK,但没有发送电子邮件。 知道我错过了什么吗?
试试这个,可能是因为 smpt 只适用于信任 API。
function sendEmail(){
Email.send({
Host : "smtp.elasticemail.com",
Username : "elasticmailuser@mail.com",
Password : "password given by elasticmail",
To : 'mymail@mail.com',
From : 'your username',
Subject : document.getElementById("subject").value,
Body : getElementById("body").value
}).then(
message => alert("Message send succesfully!")
);
}
希望能帮助到你
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.