Hi ,
I am trying to send email using following code in python version 3,5,2 and sendgrid 6.0.2
from sendgrid import *
from sendgrid.helpers.mail import *
import base64
import sys
from_email = Email("from")
to_email = Email("t0")
subject = "Sending with SendGrid is Fun"
content = Content("text/plain", "a")
mail = Mail(from_email, subject, to_email, content)
sg = sendgrid.SendGridAPIClient("key")
data = mail.get()
response = sg.client.mail.send.post(request_body=data)
it is giving me following error
TypeError: <sendgrid.helpers.mail.email.Email object at 0x000001B5D47A7668> is not JSON serializable
- sendgrid-python Version: master (latest commit: [commit number]) 6.0.2
- Python Version: 3.5.2
Hi ,
I am trying to send email using following code in python version 3,5,2 and sendgrid 6.0.2
from sendgrid import *
from sendgrid.helpers.mail import *
import base64
import sys
from_email = Email("from")
to_email = Email("t0")
subject = "Sending with SendGrid is Fun"
content = Content("text/plain", "a")
mail = Mail(from_email, subject, to_email, content)
sg = sendgrid.SendGridAPIClient("key")
data = mail.get()
response = sg.client.mail.send.post(request_body=data)
it is giving me following error
TypeError: <sendgrid.helpers.mail.email.Email object at 0x000001B5D47A7668> is not JSON serializable