开发者

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_statement

        # 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()

Basically I need to set a different email address to reply to w开发者_运维技巧hen the client clicks the "reply to" button from his email client .


message.reply_to ='example@googlemail.com' 


Here is an example:

    mail.send_mail(sender = email0,
                   reply_to = email1,
                   to = email2,
                   subject = subject,
                   body = body)
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜