Ejemplo n.º 1
0
def send_api_mail(subject, to, body):
    sg = sendgrid.SendGridAPIClient(apikey=os.getenv('SENDGRID_API_KEY'))
    from_email = SGEmail('Frank Zheng <*****@*****.**>')
    to_email = SGEmail(to)
    content = Content("text/plain", body)
    email = SGMail(from_email, subject, to_email, content)
    sg.client.mail.send.post(request_body=email.get())
Ejemplo n.º 2
0
def send_api_mail(subject, to, body):
    sg = sendgrid.SendGridAPIClient(apikey=os.getenv('SENDGRID_API_KEY'))
    from_email = SGEmail('Grey Li <*****@*****.**>')
    to_email = SGEmail(to)
    content = Content("text/plain", body)
    email = SGMail(from_email, subject, to_email, content)
    sg.client.mail.send.post(request_body=email.get())
Ejemplo n.º 3
0
def send_api_mail(subject, to, body):
    sg = sendgrid.SendGridAPIClient(apikey=os.getenv('SENDGRID_API_KEY'))
    from_email = SGEmail('*****@*****.**')
    to_email = SGEmail(to)
    content = Content("text/plain", body)
    email = SGMail(from_email, subject, to_email, content)
    # 发送邮件post表单
    sg.client.mail.send.post(request_body=email.get())