HTML outlook

Cant seem to get this working, and yes i have searched the forums :stuck_out_tongue:

im trying to send this :

 <header><title>This is title</title></header>
 Hello world

As the body of an email to the receiver should just see “Hello world”

Ive tried :

Pasting it into the body, adding " "'s around it, adding “to.string” , made sure “ishtml” was checked.

ive also tried assigning it to a STR variable but that didn’t work either.

and finally i tried saving it as a .txt and a .htm file, then importing to a variable but that didnt work.

so any advice would be greatly appreciated as I want to send more advanced html emails in future.

update :
Ive managed to get this working when i save it as a .txt file then use a read text file activity to save it as a string variable, and then send that variable as the body of the mail.

but i really would prefer to do this within uipath so that in future I can populate emails with peoples names etc for other variables.

Ok ive manged to work it out!

basically UIpath expects everything to be a string, so you have to write HTML as a VB string lol

example of “hello Dave !” :

‘Assign [name] = [ “Dave” ]’

each line must be a valid VB string. You can return a line using “Environment.Newline”

"<html>" & Environment.Newline &
  "<body>" & Environment.Newline &
 "<p> Hello " + name.tostring + " !"" </p> " & Environment.Newline &
 "</body>" & Environment.Newline &

When sent in an email the above will simply say

Hello Dave !

1 Like