使用python和google app引擎设置“回复”地址

时间:2011-07-05 19:33:51

标签: python google-app-engine

我有一个基于GAE邮件API的电子邮件Web服务。如何设置“回复”地址?

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

基本上我需要设置一个不同的电子邮件地址,以便在客户点击其电子邮件客户端的“回复”按钮时进行回复。

2 个答案:

答案 0 :(得分:4)

message.reply_to ='example@googlemail.com' 

答案 1 :(得分:0)

以下是一个例子:

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