文章詳情頁
javascript - nodemailer連接超時,怎么解決?
瀏覽:135日期:2023-09-30 09:15:18
問題描述
使用的是Gmail
const smtpTransport = nodemailer.createTransport({service: 'gmail',auth: { user: 'xxxxxx@gmail.com', pass: 'xxxxx'} }) const mailOptions={from: 'xxxxxx@gmail.com',to : ’xxxx@qq.com’,subject : req.query.subject,text : req.query.content } smtpTransport.sendMail(mailOptions, function(error, response){if(error){ console.log(error); res.status(504).end('error');}else{ console.log('Message sent: ' + response.message); res.status(200).end('sent');} })
有時候可以成功發送郵件,有時候發送超時,qq郵箱也設置了白名單,是不是qq郵箱有限制次數?怎么解決
問題解答
回答1:應該是gmail郵箱服務的問題。你試一下163或者sina的郵箱,應該就沒問題。
標簽:
JavaScript
相關文章:
1. node.js - nodejs中把熱request保存下來,使用JSON.stringify(req)報錯,請問怎么解決?2. nginx 500錯誤,怎么解決?3. python - angular route 與 django urls 沖突怎么解決?4. c++ - QWebEngineView加載url后直接點擊鏈接沒有反應要怎么解決?5. 百度地圖api - Android百度地圖SDK,MapView上層按鈕可見卻不可觸,怎么解決?6. Angular.js 無法設置Authorization頭,該怎么解決?7. javascript - 請問一下fullpage只能初始化一次的問題怎么解決?8. android - 啟動模擬器的,報“Could not automatically detect an ADB binary……”,要怎么解決?9. angular.js - Beego 與 AngularJS的模板格式沖突,該怎么解決?10. 請問這個怎么解決?
排行榜
