本章节我们在项目上集成mail,实现发送邮件功能
我的常用邮箱是126邮箱, 如果需要在项目上使用这个邮箱发送邮件,需要开启SMTP服务。...port: 25,
ignoreTLS: true,
secure: false,
auth: {
user: '你的邮箱地址...',
pass: '刚才复制的密码',
},
},
defaults: {
from: '"名字" 地址>',...class ExampleService {
constructor(private readonly mailerService: MailerService) {}
/**
* 邮件发送...text: text,
html: html,
})
.then(() => {})
.catch(() => {});
}
}
5 发送邮件