node.js - nodemailer and zoho email issue '530 Must issue a STARTTLS command first.' -


i using latest version of nodemailer version 4.1.0. tried using sample code available here https://nodemailer.com/smtp/

here code

 let transporter = nodemailer.createtransport({         host: 'smtp.zoho.com',         port:587,         secure: false,                    auth: {             user: this.user,             pass: this.password         }     });       var mailoptions: nodemailer.sendmailoptions = {         from: ****@***.com,         to: test@abc.com,         subject: 'hello ✔',         text: 'hello world ✔',          html: '<b>hello world ✔</b>'     };     transporter             .sendmail(mailoptions)             .then(                 (info) => {                   //  console.log(info);                     resolve({status: info.messageid})                 }             )             .catch(err => {              //   console.log(err);                 reject({status: err.tostring()})             }) 

i following error. have set secure flag false, , have used ignodetls. previous version of nodemailer 0.7.1 did not have issues. missing out on specific configuration?

   { error: invalid login: 530 must issue starttls command first. @ smtpconnection._formaterror  (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:577:19) @ smtpconnection._actionauthcomplete (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:1306:34) @ smtpconnection._responseactions.push.str (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:349:26) @ smtpconnection._processresponse (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:733:20) @ smtpconnection._ondata (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:529:14) @ socket._socket.on.chunk (c:\project\notificationservice\node_modules\nodemailer\lib\smtp-connection\index.js:481:47) @ emitone (events.js:96:13) @ socket.emit (events.js:188:7) @ readableaddchunk (_stream_readable.js:176:18) @ socket.readable.push (_stream_readable.js:134:10) @ tcp.onread (net.js:548:20)   code: 'eauth',   response: '530 must issue starttls command first.',   responsecode: 530,   command: 'auth plain' } 

you can use without these tls parameter default value false. got error because of don't pass service:'zoho' in nodemailer

let transporter = nodemailer.createtransport({         service:'zoho',         host: this.service,         port:587,         secure: false,         auth: {             user: this.user,             pass: this.password         }     }); 

Comments

Popular posts from this blog

angular - Ionic slides - dynamically add slides before and after -

minify - Minimizing css files -

Add a dynamic header in angular 2 http provider -