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
DannyK89DannyK89 

Sending an Email via apex code.

I was wondering if there is a way to send a email using the email field of a custom object using apex. I have tried a lot of differnt techniques and nothing seems to be working for me. Can someone please give me a clue as to how I can accomplish this. 

Best Answer chosen by Admin (Salesforce Developers) 
sales4cesales4ce

If i understand it correctly, you want to send an email to the Email address thats on the record via Apex code.

I do not know your criteria and its complexity, but this is something you can get it done via a Workflow rule as well.

 

To give you a start on how to send via Apex code, please refer below:

http://www.forcetree.com/2009/07/sending-email-from-your-apex-class.html

 

Hope it helps!

 

Sales4ce

All Answers

DCBoyDCBoy

Not sure if I fully understand what you are asking, here is the link to Apex guide on sending emails. If this is not what you were looking for, try putting in code snippets where it didnt work.

sales4cesales4ce

If i understand it correctly, you want to send an email to the Email address thats on the record via Apex code.

I do not know your criteria and its complexity, but this is something you can get it done via a Workflow rule as well.

 

To give you a start on how to send via Apex code, please refer below:

http://www.forcetree.com/2009/07/sending-email-from-your-apex-class.html

 

Hope it helps!

 

Sales4ce

This was selected as the best answer