kis*_*zod 3 smtp node.js express nodemailer
我试图找出问题所在,但一切都配置正确。我使用gmail,但是当我部署我的nodejs网站时,立即被阻止。在我尝试 Outlook 电子邮件后,设置遇到了一些问题,但在本地主机上工作,并且也在服务器上工作。过了一天,当我想尝试时,也被阻止了。当网站位于服务器上时有人想要发送电子邮件时,我应该使用什么类型的电子邮件,该电子邮件是免费的,并且与 Nodemailer 完美配合且不会阻塞?
\nlet transporter = nodemailer.createTransport({\n host: "smtp-mail.outlook.com",\n secureConnection: false,\n port: 587,\n tls: {\n ciphers:\'SSLv3\'\n },\n auth: {\n user: \'example@outlook.com\',\n pass: \'xxxx\'\n }\n });\n\n let mailOptions = {\n from: \'<example@outlook.com>\',\n to: \'example@outlook.com\',\n subject: \'Bek\xc3\xbcld\xc3\xb6tt recept: \' + req.body.recipename,\n text: \'\',\n html: "",\n attachments: [{\n filename: imageName,\n path: newuploadPath\n }]\n };Run Code Online (Sandbox Code Playgroud)\r\n我使用了Zoho Mail,效果很好。确保在from字段中使用相同的 Zoho 电子邮件地址mailOptions,否则会引发错误。
var transport = nodemailer.createTransport({
host: 'smtp.zoho.eu',
port: 465,
secure: true, //ssl
auth: {
user:process.env.EMAIL,
pass:process.env.EMAIL_PASSWORD
}
});
var mailOptions = {
from: process.env.EMAIL,
to: req.body.email,
subject: "Subject",
html: ""
};
Run Code Online (Sandbox Code Playgroud)
一般来说,Gmail 不是与 Nodemailer 一起使用的首选服务,因为它针对的是真实用户,而不是自动/编程使用。有关详细信息,请参阅Nodemailer 与 Gmail 。这里还列出了 Nodemailer知名服务支持的替代电子邮件服务。
| 归档时间: |
|
| 查看次数: |
5331 次 |
| 最近记录: |