Sending Emails With Python – Real Python
realpython.com › python-send-emailSendGridAPIClient (apikey = os. environ. get ("SENDGRID_API_KEY")) from_email = Email ("my@gmail.com") to_email = Email ("your@gmail.com") subject = "A test email from Sendgrid" content = Content ("text/plain", "Here's a test email sent through Python") mail = Mail (from_email, subject, to_email, content) response = sg. client. mail. send. post (request_body = mail. get ()) # The statements below can be included for debugging purposes print (response. status_code) print (response. body ...