GAE(python)需要如何接收邮件并在留言板上发布,然后向所有用户发送邮件?
有人知道我的程序有什么问题吗?? 我写了一个main.py。并将其发送给GAE。 但当我在GAE上键入一些单词时,它无法向表中的作者发送邮件GAE(python)需要如何接收邮件并在留言板上发布,然后向所有用户发送邮件?,python,google-app-engine,email,Python,Google App Engine,Email,有人知道我的程序有什么问题吗?? 我写了一个main.py。并将其发送给GAE。 但当我在GAE上键入一些单词时,它无法向表中的作者发送邮件 class Send(webapp.RequestHandler): def send(self): mail.send_mail(sender=users.get_current_user(), to=Greeting.autho
class Send(webapp.RequestHandler):
def send(self):
mail.send_mail(sender=users.get_current_user(),
to=Greeting.author.all(),#Table
body=self.request.get('content'))
self.redirect("/")
application = webapp.WSGIApplication([
('/', MainPage),
('/sign', Guestbook),##click sign to use Guestbook
('/sign', Send)
], debug=True)
class ReceiveEmail(InboundMailHandler):
def receive(self,message):
logging.info("Received email from %s" % message.sender)
plaintext = message.bodies(content_type='text/plain')
mail.send_mail(sender=mail_message.sender,
to=m.Greeting.author.all(),
body=plaintext)
application = webapp.WSGIApplication([
ReceiveEmail.mapping()
], debug=True)
我写了一个handle\u incoming\u email.py
试着发邮件到123@http:appid.appspotmail.com
但我看不到表中的任何内容,也无法向表中的作者发送邮件
class Send(webapp.RequestHandler):
def send(self):
mail.send_mail(sender=users.get_current_user(),
to=Greeting.author.all(),#Table
body=self.request.get('content'))
self.redirect("/")
application = webapp.WSGIApplication([
('/', MainPage),
('/sign', Guestbook),##click sign to use Guestbook
('/sign', Send)
], debug=True)
class ReceiveEmail(InboundMailHandler):
def receive(self,message):
logging.info("Received email from %s" % message.sender)
plaintext = message.bodies(content_type='text/plain')
mail.send_mail(sender=mail_message.sender,
to=m.Greeting.author.all(),
body=plaintext)
application = webapp.WSGIApplication([
ReceiveEmail.mapping()
], debug=True)
有关接收电子邮件的信息,请参阅
有关发送电子邮件的信息,请参阅
e、 g
我建议您阅读Python入门指南(),其中有一个简单留言簿的演示。然后阅读邮件API概述()。