使用nodemailer在邮件的文本正文中发送重定向URL

时间:2017-07-27 09:04:34

标签: node.js

我想发送有效的邮件,但我想将重定向网址发送到邮件文本

var mailOptions = {
          from: 'sachincoder96@gmail.com',
          to: user_info.email,
          subject: 'Sign up confirmation.',
          text: 'Go to this link for confirmation of your registration'+ http://localhost:8000/user/registration/confirmation?id=id
        };

但由于':'和//这导致我收到错误。

 text: 'Go to this link for confirmation of your registration'+ localhost:8000/user/registration/confirmation?id=id

1 个答案:

答案 0 :(得分:1)

URL是字符串的一部分,您的语法无效。

text: 'Go to this link for confirmation of your registration http://localhost:8000/user/registration/confirmation?id=id'