猿问

google appengine收到电子邮件错误

我有麻烦了。我现在玩很长时间了,在google应用中收到电子邮件,但是在我的应用中,日志仅显示以下内容:


0.1.0.20 - - [13/Jun/2013:08:42:23 -0700] "POST /_ah/mail/contact@myappid.appspotmail.com HTTP/1.1" 200 0 - - "myappid.appspot.com" ms=69 cpu_ms=0 cpm_usd=0.100008 app_engine_release=1.8.1 instance=00c61b117c2fb913155f167711d12979c818fd

我的邮件处理程序脚本应为:mailmain.py


import logging

import webapp2

from google.appengine.ext.webapp.mail_handlers import InboundMailHandler

from google.appengine.api import mail 


class LogSenderHandler(InboundMailHandler):

    def receive(self, mail_message):

        tobesent = mail_message.subject

        logging.info("From: " + mail_message.sender)

        logging.info("To:" + mail_message.to)

        logging.info("Subject: " + mail_message.subject)

        logging.info("Date: " + mail_message.date)


app = webapp2.WSGIApplication([LogSenderHandler.mapping()], debug=True)

而我的app.yaml是这样的:


application: myappid

version: 1

runtime: python27

api_version: 1

threadsafe: no


handlers:

- url: /favicon\.ico

  static_files: favicon.ico

  upload: favicon\.ico


- url: /_ah/mail/contact@myappid.appsportmail.com

  script: mailmain.py 

  login: admin


- url: /.*

  script: mailmain.py


inbound_services:

- mail

我尝试过使用该脚本,所以我有很多版本,某些版本以此结尾(如果这很重要),但实际上没有任何效果:


def main():

    app = webapp2.WSGIApplication([LogSenderHandler.mapping()], debug=True)

    run_wsgi_app(application)

if __name__ == "__main__":

    main()

我也上传了一个favicon.ico。


Google错误数小时之久,无济于事。在这里,我在Stackoverflow上找到了类似的错误消息解决方案,例如correct recieveinto,receive但是这里不是这种情况。我也复制了其他解决方案,也从GITHUB复制了此解决方案,因此我相信这个问题不是重复的。


守着星空守着你
浏览 174回答 1
1回答
随时随地看视频慕课网APP

相关分类

Python
我要回答