npm install express
npm install nodemailer
{
"Gmail": {
"user": "email",
"pass": "password"
}
}node email.js
- 輸入 http://localhost:5000/send
- 收件人要從 req 傳輸
from: mailconfig.Gmail.user, //寄件人
to: req.body.email, //收件人
subject: '信件標題',
text: '信件內容'Send success!!!
表示成功
Send fail!!!
表示失敗