2017-09-15 7 views
0

GoDaddy가 nodemailer에서 호스팅하는 전자 메일을 사용하는 방법을 알고 있는지 궁금합니다. 내 연락처 양식에서 이메일 제출 상자가 있고, 다음과 같은 스크립트를 트리거 : 나는 몇 가지 다른 옵션을 시도했습니다GoDaddy로 nodemailer를 설정하는 동안 오류 535

function sendEmail (to, subject, body) { 

var transporter = nodemailer.createTransport({ 
    service: 'Godaddy', 
    host: "relay-hosting.secureserver.net", 
    port: 465, 
    secureConnection: true, 
    auth: { 
    user: '[email protected]', 
    pass: 'password' 
    } 
    }); 

var mailOptions = { 
    from: '[email protected]', 
    to: to, 
    subject: subject, 
    text: body 
}; 

transporter.sendMail(mailOptions, function(error, info){ 
    if (error) { 
    console.log(error); 
    } else { 
    console.log('Email sent: ' + info.response); 
    } 
}); 
} 

을 내 포트가 모두 열려있는 것을 확인했다,하지만 난 하드를 보내고있어 인증 시간. 다음과 같은 오류가 계속 발생합니다.

{ Error: Invalid login: 535 Authentication Failed for [email protected] User does not have any relays assigned. 
    at SMTPConnection._formatError (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:577:19) 
    at SMTPConnection._actionAUTHComplete (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:1306:34) 
    at SMTPConnection._responseActions.push.str (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:349:26) 
    at SMTPConnection._processResponse (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:733:20) 
    at SMTPConnection._onData (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:529:14) 
    at Socket._socket.on.chunk (/var/www/node/node_modules/nodemailer/lib/smtp-connection/index.js:481:47) 
    at emitOne (events.js:96:13) 
    at Socket.emit (events.js:188:7) 
    at readableAddChunk (_stream_readable.js:176:18) 
    at Socket.Readable.push (_stream_readable.js:134:10) 
    at TCP.onread (net.js:547:20) 
    code: 'EAUTH', 
    response: '535 Authentication Failed for [email protected] User does not have any relays assigned.', 
    responseCode: 535, 
    command: 'AUTH PLAIN' } 

모든 의견이나 제안은 정말 감사하겠습니다.

답변

2

이 오류는 호스트 이름과 관련이있는 것으로 보입니다. 다음을 시도하십시오.

var transporter2 = nodemailer.createTransport({ 
    service: 'Godaddy', 
    host: "smtpout.secureserver.net", 
    secureConnection: true, 
    port: 465 
})