craftygirl x
2018-08-06 15:48:51 UTC
I have case where I send multiple emails( with different contents and
subjects), all in array , traversed in a loop to deliver multiple
receipients.
First I used simple nodemailer and i found more than 5 emails in a row, i
get errors.
I have input data in a json form where I calculate how many emails and what
contents will go. So senders list and contents are not static and
calculated in same code before sending out emails.
so first case,
1. Use simple nodemailer. Mail sending part is a promise. Works but not
more than 5. Each email 's return messages etc can be tracked fine and
final results can be returned since emails work sequential.
2. Use nodemailer-smtp-pool to increase number of emails.
Strange that emails do not work normal. 1 or 2 emails are sent and 3rd not.
Then if I trigger email code multiple times, within seconds it works once
or twice with error messages.
"Mail Command Failed: 421 #4.x.2. too many messages for this session"
Code is:
var smtpPool = require('nodemailer-smtp-pool')
pooledTr =nodemailer.createTransport( smtpPool{ host: "", secure:false,
port: 25, maxConnections:25, maxMessaes:50, rateLimit:10...})
then in a loop for all the emails,
pooledTr.sendMail(mOptions , (err, callback)=>{....})
Now, we do not have promise anymore, as we do not want to wait till first
email send and returns.
Can any one help if I need to use events in pooledtransported, like wait
till connection is idle to send. Also If I need to add time wait or promise
till it delivers?
I googled but do not what examples per my scenario.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/21f2e8a3-3d32-48ad-b305-bf047f2db147%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
subjects), all in array , traversed in a loop to deliver multiple
receipients.
First I used simple nodemailer and i found more than 5 emails in a row, i
get errors.
I have input data in a json form where I calculate how many emails and what
contents will go. So senders list and contents are not static and
calculated in same code before sending out emails.
so first case,
1. Use simple nodemailer. Mail sending part is a promise. Works but not
more than 5. Each email 's return messages etc can be tracked fine and
final results can be returned since emails work sequential.
2. Use nodemailer-smtp-pool to increase number of emails.
Strange that emails do not work normal. 1 or 2 emails are sent and 3rd not.
Then if I trigger email code multiple times, within seconds it works once
or twice with error messages.
"Mail Command Failed: 421 #4.x.2. too many messages for this session"
Code is:
var smtpPool = require('nodemailer-smtp-pool')
pooledTr =nodemailer.createTransport( smtpPool{ host: "", secure:false,
port: 25, maxConnections:25, maxMessaes:50, rateLimit:10...})
then in a loop for all the emails,
pooledTr.sendMail(mOptions , (err, callback)=>{....})
Now, we do not have promise anymore, as we do not want to wait till first
email send and returns.
Can any one help if I need to use events in pooledtransported, like wait
till connection is idle to send. Also If I need to add time wait or promise
till it delivers?
I googled but do not what examples per my scenario.
--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+***@googlegroups.com.
To post to this group, send email to ***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/21f2e8a3-3d32-48ad-b305-bf047f2db147%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.