Reply an email with appending existing body containing images and table

Hey Guys,

I intend to reply to the below email keep its existing content. I tried a lot of them. I only succeeded to retain the text[Second image] How do I retain the images and tables? There must be a better way that the community might have tried.

In the below example, Only the text is getting reatained.

1 Like

Looks like you’ve lost all your text decoration too. Are you replying using Plain Text instead of HTML?

When i select the HTML option from properties, it replied in plain text.

I am using an existing solution from one of the folks here to improve. Any luck how it is done without UiAutomation?

MailReply.xaml (10.8 KB)

1 Like

In the xaml you attached, the Body of your reply consists of the header data from the mail received like From, Date, Subject, etc… Nothing like your original example.

That’s because you the email is in my outlook. It reads the email and just replies. That is the logic in the xaml.

If this solution is from below post, it doesn’t work for html templates.

One way is to reply via Vbscript (using Start Process or PowerShell)

image

Const olFolderInboxItems = 3
Dim Items 
Dim objSubject
Dim Arg
Set Arg = WScript.Arguments
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
Set objInbox = objNamespace.GetDefaultFolder(olFolderInboxItems )'Inbox
Set Items = objInbox.Items
Items.Sort "[Received]",True
ReplyEmail(Items)

Sub ReplyEmail(objItems)
	For Each objItem in objItems 
	  objSubject = Arg(0)   '1st Argument as Subject from Start Process Activity
	  objsubject = objItem.subject 
	  if Instr(objsubject,objSubject) <> 0 then
	  Set olReply = objItem.ReplyAll
                  olReply.HTMLBody = "Hello, Reply from Robot. Thank you. " & vbCrLf & olReply.HTMLBody 'Append Body
                  olReply.Send
	  Exit For
	  end if 
	 Next
End Sub

Yes Vinay. It is indeed. any idea on how you can make this work with images and tables?

Using Vbscript :wink:

Thanks, it works for me. But the account is my Outlook acc in my laptop right? How does this work with uipath orchestrator?