javascript - nodemailer连接超时,怎么解决?
巴扎黑
巴扎黑 2017-04-17 16:30:46
0
1
543

使用的是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의 이메일 주소를 사용해 보세요. 괜찮을 것입니다.

최신 다운로드
더>
웹 효과
웹사이트 소스 코드
웹사이트 자료
프론트엔드 템플릿