App Engine provides a service for sending email messages from web applications.
The sender ("From:") address of a message sent from an application must be the email address of a registered administrator. Errors and bounce messages are sent to the sender address. The sender address also receives a copy of the message.
from google.appengine.api import mail
class ConfirmUserSignup(webapp.RequestHandler):
def post(self):
user_address = self.request.get("email_address")
if not mail.is_email_valid(user_address):
# prompt user to enter a valid address
else:
confirmation_url = createNewUserConfirmation(self.request)
sender_address = "support@example.com"
subject = "Confirm your registration"
body = """
Thank you for creating an account! Please confirm your email address by
clicking on the link below:
%s
""" % confirmation_url
mail.send_mail(sender_address, user_address, subject, body)