2011-10-13 109 views
0

我为我的node.js应用程序使用https://github.com/eleith/emailjs 正确设置配置后,当我发送电子邮件时,我在我的日志中获得了成功的消息,但是我没有看到 我使用Gmail,smtp.gmail.com,SSL的收件箱或spambox :-(任何邮件..:真的,端口:465node.js发送邮件成功,但没有发现邮件

email.send({...},function(err, message) { 
     if (err) { 
      console.log('Error sending email : ', err); 
     } 
     else { 
      console.log('Email SUCCESSFULLY sent', message); 
     } 

^[[32m[2011-10-13 06:53:28.758] [INFO] console - ^[[39mEmail SUCCESSFULLY sent { 
attachments: [], 
    html: null, 
    header: 
    { 'message-id': '<[email protected]>', 
    from: '[email protected]', 
    to: '[email protected], ', 
    cc: '[email protected]', 
    subject: 'Test mail from emailjs' }, 
    content: 'text/plain; charset=utf-8', 
    text: 'Testing sending email' } 

回答

0

我用下面的代码为我的电子邮件节点.js(使用emailjs

var server = email.server.connect({ 
    user: '[email protected]', 
    password: 'gmailPass', 
    host: 'smtp.gmail.com', 
    ssl: true 
}); 

server.send({ 
    text: 'hello world', 
    from: '[email protected]', 
    to: '[email protected]', 
    subject: 'just a subject here' 
}, function(err, message) { 
    if (err) { 
    // err 
    } else { 
    // ok 
    } 
}); 
+0

这是我使用的到底是什么?不知道怎么回事..如果我提供错误的配置,它会抛出错误。但使用正确的配置时,它会在日志文件中显示“电子邮件已成功发送”。但最终我没有看到任何电子邮件来到“到”电子邮件ID。 – user644745

0

问题在'to'电子邮件中使用逗号(,[email protected]”,。我试图通过添加逗号(,)分隔的多个ID和产生的问题..

在本文档中,他们提到,虽然

**"someone <[email protected]>, another <[email protected]>"** 
may be it expects the email format to be in the form they mentioned. 
相关问题