Hi @Latif
Got it, now the requirement is clear.
Since you want both:
- your new formatted text at the top
- the complete original email below it
don’t put varMailMessage itself inside the Body because Body expects a String, not a MailMessage object.
Create one final body string, something like:
varFinalBody =
varTextToEmployee +
"
----- Original Message -----
" +
varMailMessage.Body
Then pass varFinalBody to the Body field.
If the original email already contains HTML formatting like tables, colors, signature etc., better use the HTML body instead of .Body, for exampl
varFinalBody =
varTextToEmployee +
"
----- Original Message -----
" +
varMailMessage.Headers(“HTMLBody”).ToString
Keep varMailMessage in Source email as you have now, so UiPath knows which mail/thread you are replying to.
One important point: if varTextToEmployee contains , or
tags, the Body needs to be treated as HTML. If this particular activity/version does not expose HTML body support, I would suggest using Reply to Email inside Use Desktop Outlook App, where you can select Body as HTML.
So basically:
Source email = varMailMessage
Body = your new HTML text + original email body
This should give you both the new formatted message and original mail content in the reply.