![](/img/trans.png)
[英]How do I send email from nodemailer in nodejs using gmail?
[英]How to send email using nodemailer and gmail?
我正在使用nodemailer以便向客戶發送電子郵件。
這是我如何配置運輸機:
const mailTransport = nodemailer.createTransport({
service:'Gmail',
auth: {
user : "xxxx",
pass : "xxxx",
});
不幸的是,它不起作用,並且出現“無效的登錄錯誤”。 我在網上檢查並通過設置帳戶授予“較少的安全連接”權限。
不幸的是我堅持同樣的錯誤...
可以解釋一下我該怎么做?
謝謝
建議為GMail生成一個應用程序密碼 ,並將其與Nodemailer一起使用。
這將繞過使用標准密碼時可能會出現的所有2FA對話框和任何“登錄授權”。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.