Font in Send Mail Activity is Wrong on Outlook

Hi there,

I have a problem with Ui Path Studio when trying to send emails, whereby it creates the body of the email on Outlook in a different font than the one my Outlook is set to use (Aptos).

I have ensured that Outlook is set to send mails in HTML format, as well as ensured that IsBodyHTML is ticked in the activity.

I have also specified the font I want in the txt file that the activity uses to form the body of the email, however the first line of the email is created through UI Path as it inserts the word “Hi” followed by the name of the recipient pulled from an Excel Spreadsheet. The string in is: "Hi " + Name + Environment.NewLine + Environment.NewLine + BodyBlurb, meaning that even though the body of the email from the txt file is now in the right font, the first line is not changed with the html font tag.

Usually, I don’t need any html font tags in my txt file to get the right font. Also, the Classic Outlook displays the wrong font, but the New Outlook (or web version) displays the correct one.

Images are below. Please excuse me if I haven’t used all the right terms. I am not yet experienced with all the inner-workings of Ui Path and I’m just trying to find a solution. I have looked into the other posts here as much as I can at the moment.


Hello @RyanTSG ,
As I understand, the issue you are facing is that the first line of your email, dynamically created in UiPath, does not match the desired font (Aptos) even though IsBodyHTML is enabled.
You should try to define the style, font, and size directly in HTML, like-

"<html><body style='font-family:Aptos; font-size:12pt;'>" +
"Hi " + Name + "<br><br>" + BodyBlurb + "</body></html>"

Please let me know if my understanding is correct or if you’d like to discuss further!

1 Like

Hi @Ankit_Kumar2

Thanks for your response.

I’ve tried this now, however the email comes out blank. Does it have something to do with the fact that the body of the email is taken from a normal text file?

Hi @RyanTSG

I am suggesting you to use the Create HTML Content activity and give the Body of the mail as it is then change the fonts and size there. Then create a variable to the output of Create HTML Content activity and pass that variable to the body field in Send outlook mail message activity and keep check the IsbodyHTML.

Hope it helps!!

1 Like

Hi @mkankatala,

Oh ok thank you.

I put that that string into the Body section in the activity and it worked - all fonts are changed including the first line of text. I’m not sure if this is the same as what you are referring to, but this ended up working for me before I saw your comment.

1 Like

Hello @RyanTSG
That’s great to hear, glad it worked for you! :blush: Using HTML for emails is super helpful, especially when you need to customize fonts, add tables, or include colors and formatting. It gives us full control over the design.

1 Like

You have given wrong text in Create HTML content activity, you just have to give the Body Text as it is, If you want to pass the variables you have to use the Add data values option.

Check the below image on how to give the Text in the activity,

I have highlighted add data values option from where you can add variable values to the mail body.

Hope you understand!!

1 Like

Hi @mkankatala

Ok interesting. How can I get to that window titled Edit HTML Content?

The route that I took did end up working but if there’s a better way then I’d be happy to learn how to do it.

Yes @RyanTSG

After click on Edit HTML Content that window will shown up.

This is the better way to do it orelse you have to write HTML code as your first approach.

Hope you understand!!

1 Like

Hi @mkankatala

Thank you for the advice. I will look into this when I have more time :slight_smile:

I think the reason I was confused was because the workflow that I have doesn’t have that Create HTML Content activity, so I wasn’t finding the setting you were referring to. But the suggestion from @Ankit_Kumar2 that I implemented seemed to work with what I have, so I will mark that as the solution, although I agree that what you suggested seems to be a good solution that I should investigate.

Thank you @mkankatala and @Ankit_Kumar2 for the help.

1 Like

It’s my pleasure… @RyanTSG

Happy Automation!!

1 Like

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