Can you please give me a simple, and straightforward python example of sending an HTML e-mail using App Engine? Plaintext is straightforward, but I'm having difficulties with HTML tags.
A:
This details some issues with sending HTML email on App Engine: http://code.google.com/p/googleappengine/issues/detail?id=965
Bill Zeller
2010-05-18 19:58:36
Not really caring about attachments, or images. Just basic HTML functionality, like <hr> <b>, etc
Silver Dragon
2010-05-18 20:29:04
+3
A:
I haven't tested this, so please forgive any little bugs. It's based on an example from the Google documentation: http://code.google.com/appengine/docs/python/mail/sendingmail.html
from google.appengine.api import mail
message = mail.EmailMessage(sender="Example.com Support <[email protected]>",
subject="Your account has been approved")
message.to = "Albert Johnson <[email protected]>"
message.body = """
Dear Albert:
Your example.com account has been approved. You can now visit
http://www.example.com/ and sign in using your Google Account to
access new features.
Please let us know if you have any questions.
The example.com Team
"""
message.html = """
<html><head></head><body>
Dear Albert:
Your example.com account has been approved. You can now visit
http://www.example.com/ and sign in using your Google Account to
access new features.
Please let us know if you have any questions.
The example.com Team
</body></html>
"""
message.send()
Forest
2010-05-18 20:36:02