Guest User

Untitled

a guest
Aug 17th, 2018
211
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. Google appengine Send html as an email attachment
  2. message = mail.EmailMessage(sender="My Html <html@gmail.com>",
  3.  
  4. subject="html")
  5.  
  6. message.to = "Jim <hmtl@gmail.com>"
  7.  
  8. message.body = my_body_text
  9.  
  10. message.html = my_body_html
  11.  
  12. output = StringIO.StringIO()
  13. output.write("xxxx")
  14.  
  15. message.attachments=[("xxxx.html", output.read())]
  16.  
  17. message.send()
Add Comment
Please, Sign In to add comment