python - No error when Google App Engine sends email but the receipient does not receive any emails -
i trying send email using python , google appengine using code below: main2.app
import webapp2 google.appengine.api import mail google.appengine.api import users class invitefriendhandler(webapp2.requesthandler): def post(self): user = users.get_current_user() if user none: login_url = users.create_login_url(self.request.path) self.redirect(login_url) return to_addr = "madhurima.basu@gmail.com" if not mail.is_email_valid(to_addr): # return error message... pass message = mail.emailmessage() message.sender = user.email() message.to = to_addr message.body = """ i've invited example.com! accept invitation, click following link, or copy , paste url browser's address bar: %s """ % generate_invite_link(to_addr) message.send() **app.yaml** application: r-email version: 1 runtime: python27 api_version: 1 threadsafe: no handlers: - url: /.* script: main2.py
when deploy code google engine,it runs w/o error receipient not receive emails..also in dashboard,it says 39% "recipients emailed" ..
requesting urgent on this.
check sender email address, there specific requirements. can set reply-to address user's address if that's need, actual sender has 1 of following types:
- the address of registered administrator application. can add administrators application using administration console.
- the address of user current request signed in google account. can determine current user's email address users api. user's account must gmail account, or on domain managed google apps.
- any valid email receiving address app (such xxx@app-id.appspotmail.com).
- any valid email receiving address of domain account, such support@example.com. domain accounts accounts outside of google domain email addresses not end in @gmail.com or @app-id.appspotmail.com.
more here.. https://developers.google.com/appengine/docs/python/mail/sendingmail
Comments
Post a Comment