Skip to content

Latest commit

 

History

History
23 lines (21 loc) · 725 Bytes

multiple-emails-multiple-recipients.md

File metadata and controls

23 lines (21 loc) · 725 Bytes

Send Multiple Emails to Multiple Recipients

The send method also accepts an array of email msg if you want to send multiple different single emails with for example different content and sender values. This will send multiple requests (in parallel), so be aware of any API rate restrictions:

const emails = [
  {
    to: '[email protected]',
    from: '[email protected]',
    subject: 'Hello recipient 1',
    text: 'Hello plain world!',
    html: '<p>Hello HTML world!</p>',
  },
  {
    to: '[email protected]',
    from: '[email protected]',
    subject: 'Hello recipient 2',
    text: 'Hello other plain world!',
    html: '<p>Hello other HTML world!</p>',
  },
];
sgMail.send(emails);