Forward MailMessage (SendOutlookMailMessage ) with new/modified body

Hi all,

My task is to get an email from outlook > replace some string in the body > send it to new receiver(using custom activity).

I would like to keep and work with MailMessage so I could keep the body format and signature (including pics) which means bodyHTML format.

Since this custom activity is not available yet I’m using SendOutlookMailMessage (forward message)to test the workflow. The issue is that once i forward the modified message the changes in the body are missing. It’s really strange because i log the body in Output panel just before forwarding the mail and i see that it was replaced correctly.

If i use plain text, changes in the body of the mail, are being forwarded just fine. But when i use htmlBody they are missing and I would like to keep the HTML format.

So do you have any ideas if this is issue related to forwarding the message/changing the body or I’m missing something in my workflow.

Thank you for your time!
Stefan G

Hi @stefan.germanov,

This worked for me:

If the Email that is read is a HTML Email, the same HTML format will be retained. However, do note that you will have to do the replace directly in the Activity itself as shown above and not separately in a Assign Activity.

Regards,
Nithin

1 Like

Thank you Nithin. Do you use Messages(0) as input for the forward MailMessage or you send(create) new message?
image

This works fine with the text body of the email but unfortunately we lose the images in the signature.

p.s. Is there any HTML part of the email that holds the body itself?
When i log the “MailMessage.BodyAsHtml” i dont see the body text

thanks!!!