Advertisement
themaleem

aaaaaa

Aug 16th, 2023
272
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. import os
  2. from sendgrid import SendGridAPIClient
  3. from sendgrid.helpers.mail import Mail
  4.  
  5. message = Mail(
  6. from_email='from_email@example.com',
  7. to_emails='to@example.com',
  8. subject='Sending with Twilio SendGrid is Fun',
  9. html_content='<strong>and easy to do anywhere, even with Python</strong>')
  10.  
  11. sg = SendGridAPIClient(os.environ.get('SENDGRID_API_KEY'))
  12. response = sg.send(message)
  13. print(response.status_code, response.body, response.headers)
  14.  
  15.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement