Back to Sendgrid Nodejs

Send a Single Email to a Single Recipient

docs/use-cases/single-email-single-recipient.md

8.1.6332 B
Original Source

Send a Single Email to a Single Recipient

js
const sgMail = require('@sendgrid/mail');
sgMail.setApiKey(process.env.SENDGRID_API_KEY);
const msg = {
  to: '[email protected]',
  from: '[email protected]',
  subject: 'Hello world',
  text: 'Hello plain world!',
  html: '<p>Hello HTML world!</p>',
};
sgMail.send(msg);