+ Start a Discussion
Prachi Gadewar SFDCPrachi Gadewar SFDC 

Want to set 'from' in mail

Hi all,

 

I am sending mail from my batch class to given mail Ids using SingleEmailMessage instance and methods. I am setting up setSenderDisplayName to 'test'. After sending that mail, In mail for From - test<mail Id>showing like that. but I don't want to show email Id. Or receiving mailer can not reply for the same mail. Anyone know how should I achieve this?

 

Thanks.

bouscalbouscal
Are you looking for how to set the reply address?

mail.setReplyTo('noreply@all.com' (mailto:'noreply@all.com'));