We recommend using SendGrid Python, our client library, available on Github, with full documentation.

Using SendGrid’s Python Library

1
2
3
4
5
6
7
8
9
10
11
12
# using SendGrid's Python Library - https://github.com/sendgrid/sendgrid-python
import sendgrid

sg = sendgrid.SendGridClient(api_user, api_key)
message = sendgrid.Mail()

message.add_to("test@sendgrid.com")
message.set_from("you@youremail.com")
message.set_subject("Sending with SendGrid is Fun")
message.set_html("and easy to do anywhere, even with Python")

sg.send(message)