Get IMAP Messages - Unwanted (Extra) Line Breaks

Good afternoon everyone,

I have a question that I would love your help with.

I’m using the ‘Get IMAP Mail Messages’ activity to retrieve emails from a Gmail inbox.
The bot parses the first five lines of the email (using line breaks) to update a record in an ERP system.

The body of an email looks like this:
Project Name Blah
Status - Bleep
Status 2 - Bloop
EmailAddress@EmailAddress.com
This is a sample comment that needs to be written into the comment field words words words.

Unfortunately, when I extract the email body and write it out to Excel, there are additional line breaks present that are not in the email body when viewed through Gmail.

For the sample above, this is what displays when it’s written to Excel (now 6 rows long):
Project Name Blah
Status - Bleep
Status 2 - Bloop
EmailAddress@EmailAddress.com
This is a sample comment that needs to be written into the comment field
words words words.

I believe the issue lies with the PlainText portion of the method highlighted in the screenshot below. From what I can gather, PlainText appears to wrap each line at ~78 characters.
However, I need each line to be extracted exactly as it appears in the original email.

Has anyone experienced a similar issue or have an idea on how to resolve this?

What a roller coaster of forum and Google searches!

It turns out I was able to resolve this issue by parsing out the (HTML) AlternateView of the MailMessage.

From this point I was able to extract the email body between the HTML tags and proceed accordingly.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.