2010-11-24 1 views
1

GAE에서 메일 보내기/받기에 대해 읽었으며 reply_to을 사용하는 방법에 대한 질문과 답장 된 이메일 주소의 형식이 있습니다.Google App Engine (reply_to 필드)에서 메일 보내기 - 수신

register.py 단순히 데이터베이스에 message.sender를 기록 :

class User(db.Model): 
    userEmail = db.StringProperty() 
    userEmailContent = db.StringProperty() 

class Register(InboundMailHandler): 
    def receive(self, message):   
     newUser = User(userEmail = message.sender)   
     db.put(newUser) 

application = webapp.WSGIApplication([ 
    Register.mapping() 
], debug=True) 

def main(): 
    run_wsgi_app(application) 
if __name__ == "__main__": 
    main() 

incoming.py에서 나는이 이메일로 신청자의 메일에 회신 오전 :

mail.send_mail(sender="<[email protected]>", 
       to=message.sender, 
       body="reply to this email to register" 
       reply_to=/_ah/mail/[email protected]) 

내가 상상하고 신청자가이 이메일에 답장을 때 register.py은 이메일을 처리하고 신청자의 이메일 주소를 데이터베이스에 기록합니다. dev 서버에서 이것을 테스트하는 방법을 잘 모르겠습니다. 앱을 배포하기 전에 reply_to에 할당 할 올바른 이메일 주소에 대한 조언을 원했으며 이것이 올바른 처리 방법인지 확인하고 싶습니다. 감사.

답변

3

reply_to 주소는 /_ah/mail/ 접두사가없는 표준 전자 메일 주소 여야하며 sender 메일 주소와 동일한 제한을 따릅니다.

메시지의 보낸 사람 주소는 응용 프로그램, 가 로그인되어있는 현재 사용자의 Google 계정 이메일 주소, 또는에 대한 주소를 수신 유효한 이메일 에 대한 관리자의 이메일 주소를해야합니다 앱.

dev 서버에서 테스트하려면 sendmail을 구성하고 프로그램에서 메일을 보내십시오.
메일 클라이언트에서 답장을 클릭하면 코드에 reply_to 메일 주소가 표시됩니다.