Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Difficulties with sending mail from GAE
- Traceback (most recent call last):
- File "/base/python_runtime/python_lib/versions/1/google/appengine/ext/webapp/__init__.py", line 636, in __call__
- handler.post(*groups)
- File "/base/data/home/apps/spam-tool/1.349401522260793315/spam-tool.py", line 34, in post
- body=cgi.escape(self.request.get('content')))
- File "/base/python_runtime/python_lib/versions/1/google/appengine/api/mail.py", line 297, in send_mail
- message.send(make_sync_call)
- File "/base/python_runtime/python_lib/versions/1/google/appengine/api/mail.py", line 799, in send
- raise ERROR_MAP[e.application_error](e.error_detail)
- BadRequestError: Missing subject
- > message = mail.EmailMessage(sender="admin_address@gmail.com>",
- subject="test")
- message.subject=self.request.get('content')
- message.to = addr_to_send_to
- message.body = self.request.get('content')
- message.send()
- sender = '<admin_address@gmail.com>',
- from google.appengine.api import mail
- mail.send_mail(sender="something@gmail.com",
- to=email_valid.email,
- subject="Please validate your email",
- body=body_text,
- html=htmlbody_text)
- def email_member(request):
- to_addr = request.POST.get('email_to')
- if not mail.is_email_valid(to_addr):
- # Return an error message...
- pass
- else:
- # note we can also send html email, e.g. html='<html><head></head><body>Hello world</body><html>'
- mail.send_mail(
- sender='admin@yourdomain.com',
- to=to_addr,
- subject=request.POST.get('email_title'),
- body=request.POST.get('email_body'))
- def mail_member_information(email_to, email_title, email_body):
- taskqueue.add(
- url = 'email_message',
- params =
- {
- 'email_to': email_to,
- 'email_title': email_title,
- 'email_body': email_body,
- 'valid_guid': 'ae9e34ca-a2c5-476e-b8be-72d807e3dc6b'
- }
- )
Add Comment
Please, Sign In to add comment