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
nishanth0208nishanth0208 

Anyway to change FROM EMAIL ADDRESS while sending an email using singleemailmessage class

Dear All,

I 'd written apex code to send an email using singleemailmessage class. 

While sending this email i want to change the FROM ADDRESS. ByDefault, it is using the user's email id. but i want to set it to 'alerts@companyname.com'. 

Can i change the from address to achieve this?

 

Please share info!

 

thanx.

My OwnMy Own

Can you post your code once. We can change the email id at run time. 

goabhigogoabhigo

I had the similar problem. Refer this post, it might be helpful:

http://boards.developerforce.com/t5/Apex-Code-Development/Set-fromAddress-in-Email/m-p/271463#M47308