How to Send Emails with a CC and BCC using Node.js and Twilio SendGrid

1 · Twilio · Aug. 16, 2023, 4:39 a.m.
So you're building a Node.js app and you need to programmatically send some emails, including with CC and BCC fields. The Twilio SendGrid API for sending email is a great solution to this problem. If you have a SendGrid account and an API key set as an environment variable, here is all the code you need to send an email with CC and BCC fields in JavaScript: const sendgridMail = require('@sendgrid/mail'); sendgridMail.setApiKey(process.env.SENDGRID_API_KEY); const email = { to: 'TO_EM...