javascript - 如何使用 emailjs 将电子邮件发送到收件箱,每次电子邮件登陆到垃圾邮件
问题描述
下面是我用来使用 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); });
解决方案
推荐阅读
- node.js - 使用 socket.io 和 React 出现意外的 CORS 错误
- arrays - 我正在尝试查找数组中元素的重复项
- boto3 - 如何获取给定 SQS 队列 usinb boto3 的死信队列?
- python - 给定目录中的文件列表,按 mb 从小到大排序
- resources - Smalltalk:单个对象可以通过进入无限循环来阻塞整个系统吗?
- mysql - 如何查询特征表的多对多关系(AND条件)
- azure - 如何在 Azure 虚拟机中设置终结点
- javascript - 在选择多个复选框(即 5)后,我有条件将禁用的类添加到我的 div
- mysql - MySQL内部连接部分单词匹配
- laravel - Laravel 和路由