Google App Engine: how to send html using send_mail

后端 未结 2 1749
忘了有多久
忘了有多久 2021-02-06 15:52

I have a app with a kind of rest api that I\'m using to send emails . However it currently sends only text email so I need to know how to modify it and make it send html . Below

2条回答
  •  故里飘歌
    2021-02-06 16:38

    you can use the html field of EmailMessage class

    message = mail.EmailMessage(sender=emailFrom,subject=emailSubject)
    message.to = emailTo
    message.body = emailBody
    message.html = emailHtml
    message.send()
    

提交回复
热议问题