I am stuck in mail activity i need extract webmail body content I am getting item.to,Item.Subject but i am unable to get the item.body

Hi Every one,

I am stuck with webmail body extraction let me explain in detail

1.I have logged in by giving mailid , password and port 993 (GetIMapMailactivity).
2.By for Each loop i am getting in to the mail inbox
3.Here in this step i am searching for item.subject.Contains(“specific keyword”)
4.then i have taken sequence work flow
5.to verify whether cursor is going or not i have showed in messagebox
6.In Message box item.To is displaying, item.From is working, but item.Body is not working

can you any one help me on this

for reference i am sharing the screen shot of this

Thanks in advance
Jayaprakash Gurrapu

2 Likes

@gurrapujp,

Are you getting any error?

Or one more thing is, the body of your mail may contains only image

Fine
Make sure that the type argument of for each loop activity is System.Net.Mail.Mailmessage
And make sure that we have body content in those mail having the specified filter in the IF condition

You were almost done
Cheers @gurrapujp

Mail body not extracting in message alert box its getting empty

1.each step i am checking with message box like item.to,item.from every thing giving output but item.body is not getting giving empty
2.next further steps i have taken regx and sub-string methods due to mail body is giving empty output finally i am getting startindex is cannot be less than zero and system.Arguments.OutofRange exception i am getting

thanks in advance
jayaprakash

emailextractionerror9 emailextractionerror10

yes i am getting error that start index can not be less than zero
system.arguments.outofrange exception i am getting due to mailbody is giving empty output

As you are getting null values for both the strings, if you try trim, split or substring , I mean string manipulations on the empty string, you will get that errors. try removing all those manipulations and loop some 30 - 40 mails. so it will display the body of few mails leaving the mails with no body @gurrapujp

Are you getting the body as null even the body of the message is not empty?

Hi ,

  1. for each loop activity is System.Net.Mail.Mailmessage only

okay let me try in this way

before going to srting manipulations only i am checking whether body is giving content or null
even though the mail body having the content in messagealert box showing null or empty result

where as these from, to is giving correct output

I have tried with empty mail body

its getting same error same issue

1 Like

Fine i hope it must be a HTML body
Try like this
Item.Headers(“HTMLBody”).ToString

Cheers @HareeshMR

hey @gurrapujp

I guess below share existing thread link will help you on this.

Note - Please search before posting, Even you can add after your query in:Solved then you will get only solved thread/ posts as per your query.

Regards…!!
Aksh

Thanks its worked

1 Like

thanks aksh its worked

Great
Cheers @gurrapujp
Kindly close this topic with right comment marked as solution that would help others

Hi this issue has been cleared by Item.Headers(“HTMLBody”).ToString

thanks and regards
Jayaprakash

Hey @gurrapujp

I hope you will keep in mind what i mentioned :slight_smile:

you could be able to resolved it without creating a new Duplicate post and replies :slight_smile: having same thing here :slight_smile:

#hope you are understanding the essence of this request :slight_smile:

Regards…!!
Aksh

yeah definitely

Thanks @Palaniyappan this issue is cleared

1 Like