以下是我用来通过emailjs npm发送电子邮件的代码,但它始终会发送垃圾邮件。帮助我编写代码,该代码将始终向收件箱发送电子邮件
var email = require('emailjs');
var server = email.server.connect({
user: "no-reply@domain.com",
password:"password",
host: "mailserver",
ssl: true
});
var message = {
text: "i hope this works",
from: "Company Name <no-reply@domain.com>",
to: "someone <username@gmail.com>",
subject: "testing emailjs",
attachment:
[
{data:"<html>i <i>hope</i> this works!</html>",
alternative:true}
]
};
// send the message and get a callback with an error or details of
the message that was sent
server.send(message, function(err, message) { console.log(err ||
message); });