var email = require("./path/to/emailjs/email");
var server = email.server.connect({
user: "username",
password:"password",
host: "smtp.your-email.com",
ssl: true
});
var message = {
text: "... ",
from: "...",
to: "...",
subject: "testing emailjs",
attachment:
[
{data:"<html>i <i>hope</i> this helps</html>", alternative:true},
{path:"path/to/file.zip", type:"application/zip", name:"renamed.zip"}
]
};
// 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); });
whe你是否附加文件? html模板?這不是解決方案。 – dlcod