Hi All,
I am using get outlook message activity in my code where i am getting First top 1 mail on behalf of some filter.And then reading mail body as string and comparing this body text with some regex patterns and process further.
Now problem which i am getting is that, mail has multiple lines. When i am seeing it in local window variable. it has \r \n … these characters available. I tried it replacing with “” (blank string) which is also not working. Can any one suggest what i need to do for reading mail as a plain text without theses special character.
Hi
We can store that mail body to a string variable like this
Inside the FOR EACH loop where the mailmessage list variable from Get Outlook mail activity is passed as input with TYPE ARGUMENT as System.Net.Mail.MailMessage
—inside the loop use a ASSIGN activity like this str_input = item.Body.ToString
Where item is the variable from FOR EACH activity
Now this str_input variable can be used for string manipulation
To remove blank lines in the string then use this expression str_output = String.Join(Environment.NewLine,str_input.Split(Environment.NewLine.ToArray(),Stringsplitoptions.RemoveEmptyEntries))