Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created December 12, 2020 12:54
Show Gist options
  • Save Allwin12/f2b788ac7433263176cb28e24a0b2300 to your computer and use it in GitHub Desktop.
Save Allwin12/f2b788ac7433263176cb28e24a0b2300 to your computer and use it in GitHub Desktop.
import os
from sendgrid import SendGridAPIClient
from sendgrid.helpers.mail import Mail
message = Mail(
from_email="verified_email@gmail.com",
to_emails="receiver@gmail.com",
subject="test",
html_content="<p>hi</hi>"
)
try:
sg = SendGridAPIClient("XXXX API key XXXXXX")
response = sg.send(message)
except Exception as e:
print(e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment