1 import { smtpClientPool
} from
'./pool.js'
3 const tos
= ['bar@example.com, baz@example.com']
5 const smtpClientPoolPromises
= new Set
<Promise
<unknown
>>()
6 for (const to
of tos
) {
7 smtpClientPoolPromises
.add(
8 smtpClientPool
.execute({
10 host
: 'smtp.domain.tld',
14 user
: 'REPLACE-WITH-YOUR-ALIAS@DOMAIN.TLD',
15 pass
: 'REPLACE-WITH-YOUR-GENERATED-PASSWORD'
19 from
: '"Foo" <foo@domain.tld>',
23 html
: '<b>Hello world?</b>'
29 const now
= performance
.now()
30 await Promise
.all(smtpClientPoolPromises
)
31 const elapsedTime
= performance
.now() - now
33 `Send in parallel in ${elapsedTime.toFixed(2)}ms ${
35 } mails with SMTP client pool`