Setting the 'reply to' address using python and google app engine
I have an email web service based on GAE mail API . How can I set a "reply to" address ?
from future import with_statementBasically I need to set a different email address to reply to w开发者_运维技巧hen the client clicks the "reply to" button from his email client .# read data from request mail_to = str(self.request.POST.get('to')) mail_from = str(self.request.POST.get('from')) mail_subject = str(self.request.POST.get('subject')) mail_plain = str(self.request.POST.get('plain')) mail_html = str(self.request.POST.get('html')) message = mail.EmailMessage() message.sender = mail_from message.to = mail_to message.subject = mail_subject message.body = mail_plain if mail_html != None and mail_html != "": message.html = mail_html message.send()
message.reply_to ='example@googlemail.com'
Here is an example:
mail.send_mail(sender = email0,
reply_to = email1,
to = email2,
subject = subject,
body = body)
精彩评论