每次电子邮件到达垃圾邮件时,如何使用emailjs将电子邮件发送至收件箱

时间:2018-07-04 20:59:03

标签: javascript node.js email npm

以下是我用来通过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); });

0 个答案:

没有答案