first commit

This commit is contained in:
编码猿
2024-09-27 02:06:13 +08:00
commit 852d94fbb9
36760 changed files with 3274413 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
const nodemailer = require('nodemailer');
const fs = require('fs');
const path = require('path');
// https://segmentfault.com/a/1190000012251328
// 163 邮箱授权码 lb714500
// qq 邮箱授权码 ogmqticmpbnoeaje
let transporter = nodemailer.createTransport({
// 服务器地址
host: 'smtp.163.com',
// 使用了内置传输发送邮件 查看支持列表https://nodemailer.com/smtp/well-known/
service: '163',
// SMTP 端口
port: 465,
// 使用SSL
secureConnection: true,
auth: {
user: 'lb2271608011@163.com',
// 这里密码不是qq密码是smtp授权码
pass: 'lb714500',
}
});
let mailOptions = {
// "发件人名称" <发件人邮箱>
from: '"163邮箱给qq发邮件" <lb2271608011@163.com>',
// 接收人邮箱
to: '2271608011@qq.com',
// 邮件标题
subject: 'Hello',
// 发送text或者html格式
// text: 'Hello world?',
html: fs.createReadStream(path.resolve(__dirname, 'mail.html')) // html body
};
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
return console.log(error);
}
console.log(info);
});