How to extract email body using the google app engine mail api?

user3058197

I have an email that looks like this after I extract the body using the mail_message.body() function:

From nobody Sat Mar 29 12:59:23 2014
content-transfer-encoding: 7bit
MIME-Version: 1.0
Content-Type: text/plain; charset="us-ascii"

test name

Is there an easy way to strip the header lines? I just want to extract "test name" and whatever else is after that in the email body. Thank you

Sabuj Hassan

Usually the headers are separated with body by two newlines. So you can use this where it is replacing everything before the first two newlines.

body = re.sub("^[\s\S]*?[\n\r][\n\r]", "", body)

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Using Google App Engine's Mail API for django-allauth email

Using aliased email address to send mail from Google App Engine

How to send an email using JavaMail via Google App Engine

Mail Gun Email Not Working In Flask On Google App Engine

Extract using php on google app engine

How to display the name of sender instead of email address when sending email using google.appengine.api.mail.send_mail

Is there a way to change from address/email id on email sent from Google App engine Mail

How to extract small part of the mail body in outlook using Python?

Send email through Gmail API Google App Engine

How to extract small part of the email body in Outlook using Python?

How to extract data from email body using Java

How do i extract text from email body using UiPath?

Sending email with google app engine

Android app to send Email with attachment using Java Mail API

Node google api body of email

How to get google app engine admin mail address?

email dataframe as table in mail body using python

Extract mail body of outlook using javascript function

How to configure an app on Google App Engine to Receive Email on any email address?

How to send '&' symbol in email subject/html body using mailgun API?

How to extract email-ID from google login api?

How to extract href from a body email, in Perl?

How to extract full body content of email?

how should I architecture an API and front app in Google App Engine?

How to get final_url using the URL Fetch PHP API on Google App Engine?

google app engine flexible - How to start an existing version using client library or REST API

How to echo multiple lines into email body while using mail command in linux?

How to extract values from columns in CSV using a loop and use them in email body using python?

Using low level api for datastore in google app engine ? is it bad?