2011-07-05 3 views
0

私はGAEメールAPIに基づいた電子メールWebサービスを持っています。どのように "返信先"アドレスを設定できますか? pythonとgoogleのアプリエンジンを使用して「返信先」アドレスを設定する

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

基本的に、クライアントがメールクライアントから「返信先」ボタンをクリックしたときに返信する別のメールアドレスを設定する必要があります。ここで

+0

は 'message.sender = mail_from'メールの "から" のラインを設定し、それゆえ "返信先" されていませんか? – Milimetric

+0

@Milimetric "返信先"のメールアドレスは、送信元のメールアドレスと異なる場合があります。たとえば、[email protected]から電子メールを送信することができますが、[email protected]として「返信先」を設定することができます。 "reply to"が設定されていないと、私は電子メールクライアントが "From"のメールに自動的に返信すると思います。 – Michael

+0

[Google App Engine(reply_toフィールド)のメール送受信](http://stackoverflow.com/questions/) 4271958/mail-send-receive-in-google-app-engine-reply-to-field) – geoffspear

答えて

0

は一例です:

mail.send_mail(sender = email0, 
        reply_to = email1, 
        to = email2, 
        subject = subject, 
        body = body) 
関連する問題