curl -X POST https://api.sendgrid.com/v3/mail/send -H "Authorization: Bearer $SENDGRID_API_KEY" -H 'Content-Type: application/json' -d '{"personalizations":[{"to":[{"email":"user@example.com"}]}],"from":{"email":"me@example.com"},"subject":"Hello","content":[{"type":"text/plain","value":"Hi there"}]}'

Category: Mail Servers & Postfix

curl -X POST https://api.sendgrid.com/v3/mail/send -H "Authorization: Bearer $SENDGRID_API_KEY" -H 'Content-Type: application/json' -d '{"personalizations":[{"to":[{"email":"user@example.com"}]}],"from":{"email":"me@example.com"},"subject":"Hello","content":[{"type":"text/plain","value":"Hi there"}]}'

Send an email through the SendGrid API

Sends mail via the v3 API using an API key in the Authorization header; a 202 Accepted response means SendGrid queued it. The JSON body has personalizations for recipients, plus from, subject, and content. Store the key in $SENDGRID_API_KEY, never in the command itself.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.