Is there a way in sendmail of node.js to check invalid email address? -


i have mailing system written using sendmail module of node js. working fine when sending list of valid email address tolist. however, if 1 of email address wrong or non-existing , not send mail other email addresses valid.

below code :

var express = require('express'); var router  = express.router(); var sendmail = require('sendmail')();  router.post('/sendmail', function (req,res, next) {     var html = req.body.html;     var   = req.body.to;     var cc   = req.body.cc;     var sub  = req.body.sub;      sendmail({       from:'mark@mymail.com',       to: to,       cc: cc,       subject: sub,       html: html,     }, function(err, reply) {         if(err) {            res.send(err);         } else {            res.send("ok");            return;          }      }); 

now, let assume tolist looks below:

smith@mymail.com, john@mymail.com, roger@mymail.com

if of above email id wrongly spelled or not existing @ server getting error below:

"address rejected." smtp responds error code 550

is there mechanism in sendmail check @ server side if such error occurring, @ least send mail correct email address , throw error non-existing/wrong email address.


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 -