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-
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?
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.
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.
Hello @RyanTSG
That’s great to hear, glad it worked for you! 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.
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,
Thank you for the advice. I will look into this when I have more time
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.