Unable to get body of email

hey guys
iam trying to get body of email (gmail), i can extract subject but body is not getting

i have used get imap , then i used for each loop and then i used write line in that (item.body.tostring) iam using but i cant get body of mail

please guide me

Use item.Headers(“HTMLBody”) to get the mail body from the mail

Hi @Shoebmd

Do you get a blank value or an error message while trying to retrieve the body of your emails?

Could you please post a screenshot of the ‘Get IMAP Mail Messages’ properties panel?

Thanks

iam getting blank

Iam not getting error

i want body as it is in email

i tried this but iam getting in html format , i want in plane format as it is in email

please help

@Shoebmd

You could be able to removing the HTML content if do as i mentioned below

create a new string variable(new_mailBody) and assign the entire entire thing given below by replacing original_mailbody with mailmessage body.

Please refer this

bro what is the thing i have to write by replacing (original_mailbody)

please tell

Hi @Shoebmd,

I hope this link is useful to you. Very similar problem, if you follow the steps you can come to a conclusion.

Regards,
MY

here item.Headers(“HtmlBody”) will be the Original_mailbody.

new_mailBody = Convert.ToString(Regex.Replace( original_mailbody , “<[^>]+>|&nbsp”, string.Empty)).Replace(“&#8203”,string.Empty).Replace(“v:* {behavior:url(#default#VML);}”,string.Empty).Replace(“o:* {behavior:url(#default#VML);}”,string.Empty).Replace(“w:* {behavior:url(#default#VML);}”,string.empty).Replace(“.shape {behavior:url(#default#VML);}”,string.Empty)

Give onee assign activity and create a varibale like new_mailBody and instead of original_mailbody replace it with item.Header(“HtmlBody”)

then new_mailBody will be holding the plain text from the mail.

1 Like

Hi @Shoebmd ,

Could you check with the Below Expression :

MailMessageVar.Headers("PlainText")
1 Like

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