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
suresh.csksuresh.csk 

How to remove the "via details" of email when sending email through Apex

Hi.
 
Im sending mail throughtApex,the receiver mail has somethings like
 
from: tester@gmail.com via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com
 
I need to hide/disable the below when sending the mail from Apex.
" via dcs9hayusmal.o-uuh3mag.o.bnc.sandbox.salesforce.com "
 
cheers
suresh
kiranmutturukiranmutturu

r u using email services ?

 

 

suresh.csksuresh.csk

No.Just using the sendmail  method from Apex [Messaging.SingleEmailMessage]

 

kiranmutturukiranmutturu

then i think its better to go with orgwideemailaddress concept if the business requirement is not like that i think then you need to go with setsenderdisplayname  method from singlemail to eliminate that.. i think for sandboxes only it will come like that but not with production 

suresh.csksuresh.csk

Kiran.

 

Thanks for reply.

I also tried setsenderdisplayname it works fine but the via is displaying again.

OK i try from developer edition whether it works or not.

 

cheers

suresh 

shephalishephali
Hello,
         I am also trying to remove "Via details" at recepient end but unable to do so.I tried 
email.setSenderDisplayName ('Company name'); 
but its not working as expected. Its not removing "Via " at recepient end
@suresh : Did you find any solution for the same please help if any.

Thanks 
Shephali.