If your delivery service supports it (not all SMTP servers have DSN extension enabled), then you can use Delivery status notifications (DSN) with Nodemailer as defined in RFC3461.
To set up a DSN call, add a dsn property to message data
dsn – optional object to define DSN options
Non-xtext strings are encoded automatically.
let message = {
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Message',
text: 'I hope this message gets read!',
dsn: {
id: 'some random message specific id',
return: 'headers',
notify: 'success',
recipient: 'sender@example.com'
}
};
let message = {
from: 'sender@example.com',
to: 'recipient@example.com',
subject: 'Message',
text: 'I hope this message gets read!',
dsn: {
id: 'some random message specific id',
return: 'headers',
notify: ['failure', 'delay'],
recipient: 'sender@example.com'
}
};