If i am forwarding message with send outlook message why does it ignore body

Hello I am trying to forward email with sent outlook message activity. (I can’t use any other activity because only this one has replyTo field that I need). I would to like to add somthing in the body but activity in ignoring whatever I put in body if I have forward email message field filled. is there any work around? I would like to add simple string on top.

Studio version: 2024.10.6
Mail activity 1.24.1

Hi @tomaz

When using the ‘Send Outlook Mail Message’ activity in UiPath to forward an email, the ‘Forward’ property takes precedence over the ‘Body’ property. This means that if the ‘Forward’ property is populated with a MailMessage object, any content specified in the ‘Body’ field will be ignored. To add custom text to the body of the forwarded email, you can modify the ‘Body’ property of the MailMessage object before forwarding it.

So you can try this solution:

  1. Use the ‘Get Outlook Mail Messages’ activity to fetch the email you intend to forward.
  2. Modify the body like this:
    originalBody = mailMessage.BodyAsHtml
    newBody = “Your custom text here<br><br>” + originalBody
    mailMessage.BodyAsHtml = newBody
  3. Use the ‘Send Outlook Mail Message’ activity with new body.In the ‘Forward’ property, specify the modified MailMessage object. Ensure the ‘IsBodyHtml’ property is set to True to maintain HTML formatting.

Regards.

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