function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

email.sethtmlbody is not working for outlook

Hello, Anyone here already experienced using email.sethtmlbody and to send emails to outlook? Its not working for me but when using setPlainTextBody, its working.
Ankit AroraAnkit Arora

What exactly is not working? Are you using anchor tag?




Ankit Arora

Blog | Facebook | Blog Page


Hello Ankit,


I'm not receiving any emails to my outlook using  email.sethtmlbody but when I'm pointing my email to yahoo or gmail, I can received. As per my test, I tried using email.setPlainTextBody and it works for outlook. Yes, I'm using an anchor tag.



     //    email.sethtmlbody( 'Hello'+' '+tempList.Name+' '+',<br />Below is the link to approve or decline the timesheet for period'+' '+getPeriod.Name+' and project'+' '+getPeriod.Project__r.Name+'<br /><a href="'+tsDay+'">Click Here</a>');


//    email.setPlainTextBody( 'test');



Anyone,  please give me an update with this issue.

Shreyas V.Shreyas V.
I was having the same issues. After banging my head for 1 full day, i noticed when you use htmlBody, outlook puts it in JUNK mail for some reasons. When I put that sender as Trusted Sender, everything is working fine and I am able to receive email in outlook