Email Formatting from MailMessage


I am currently trying to reply to certain emails using the Reply Outlook mail activity. I am having trouble with the formatting. I am using an asset to store the body of the reply, initially I tried putting #'s in the asset text and using string.replace(“#”, vbnewline) the log message shows it formatted correctly, but when the actual email is sent, there are no new lines but the hashtags are removed.

Then I tried skipping the asset stage and actually writing the message into the body using environment.newline to seperate where I want the new lines to be, but that didn’t work either.

The email has come out like this both times:

Thanks for the help!


I recommend putting together a simple HTML mail body!

Insert linebreaks with <br> and new paragraphs with <p>.

1 Like


so I wouldn’t use the assets for this method would I? I would prefer to not have to hardcode this into the process, would this work in the config file?



of course you can do it with assets or with a config - as you wish!
You can just insert the HTML-Tags <br> and <p> into the string (asset/config/hardcoded doesn’t matter). Just remember to set the IsHtmlBody property of the mail activity to true (check box).

Let me know if it works as expected :wink:

I don’t seem to have the option to use body as html in this activity: image

Should I try to use one of the other reply activities instead?


when you pass HTML text to the mail body’s variable as part of the Reply to Outlook Mail Message activity, it is formatted correctly, even though there isn’t an option for ‘IsBodyHTML’.

1 Like

Oh! Learning something new every day.

I’m ususally using the Send Outlook Mail Message activity and assumed the Reply activity had the same property. Thanks @ghazanfar for the additional info

So passing the text through I get this response in the logs: image
it doesn’t seem to separate, do I have to change it from being a string? To some kind of HTML type or can the HTML text not be inside quotations?


Looks fine! The tags are a part of the string. It is the job of the mail service (Outlook) to transform this string into a proper mail body by processing the HTML tags.

Did you send a sample email with a HTML-Body?

1 Like

That worked perfectly, Thanks!

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