Can we deliver bulk email using single connection? #331
Replies: 7 comments
-
not with a simple toggle, but we do FIFO queueing on repeated calls to this should be enough to allow you to trivially implement some brand of pooling using promises & for-of loops, but you can let me know if you encounter difficulties doing so 😄 |
Beta Was this translation helpful? Give feedback.
-
Are there any docs for that? It'll be helpful for me. |
Beta Was this translation helpful? Give feedback.
-
it's more of a snippet kind of thing: import { Message, SMTPClient } from 'emailjs';
const client = new SMTPClient({ /* your configuration */ });
const messages: Message[] = [ /* your messages */ ];
// to queue one at a time:
for (const message of messages) {
const response = await client.sendAsync(message);
}
// --- OR ---
// to queue all at once:
const responses = await Promise.allSettled(messages.map(message => client.sendAsync(message))); |
Beta Was this translation helpful? Give feedback.
-
Are you sure by using this method all messages will be sent in one connection? |
Beta Was this translation helpful? Give feedback.
-
as long as less than one second passes between calls to |
Beta Was this translation helpful? Give feedback.
-
Ohhkay will check it out. Thanks alot! |
Beta Was this translation helpful? Give feedback.
-
Maybe this: trasherdk#4 |
Beta Was this translation helpful? Give feedback.
-
Can we deliver bulk email using single connection? Like in nodemailer there's an option for
pool
Beta Was this translation helpful? Give feedback.
All reactions