通过mailgun api发送电子邮件

时间:2020-08-23 15:46:22

标签: node.js email mailgun

我正在尝试使用Mailgun库在节点js上通过Mailgun API发送电子邮件,但是该电子邮件将转到垃圾邮件文件夹,另外,我还向域中添加了DNS,在模板代码上有“取消订阅”按钮。

let apiKey = 'API-KEY';
let domain = 'Domain';
let mailgun = require('mailgun-js')({apiKey, domain});
let email = "Email";
let dataa = {
from: '"medialocal" <no-reply@market.medialocal.com>',
to: email,
subject: 'Media local',
html: htmlCode,
subscribed: true,
};
mailgun.messages().send(dataa, function (error, body) {
console.log(body)
})

0 个答案:

没有答案