You need to sign in to do that
Don't have an account?
Sam Swann
Sending email via Apex class
Hi
Can someone help me with sending an email via Apex class?
Scenario:
Recipient: sammypuppy09876@gmail.com
Sender: no_reply@sammypuppy.com
Subject: "User Login Failed"
Text: "My Custom Text with one field from above user record"
I did workflow as well to sent out the email, but now I wanted to do same customization via Apex code (learning curve).
Thanks
After a long research by myself, I found this Apex documentation which fulfills my basic requirement.
Please go through this link:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm
This all I needed.
And this material might be helpful to someone who has the same requirement as mine.
Thanks,
Sammy
All Answers
Please try the below code.
Apex Class :
VisualForce Page :
let me know if this help you.
Happy to help You!
Thanks,
Lokesh
My Blog: http://sf2learn.blogspot.in
Hi Lokesh,
Is it possible to NOT to use any VF pages for sending out email?
For instance:
In a Community login page, if a new user tries to login without having a User record in Salesforce, I should be notified immediately via Email. It should be configured in the Apex class.
Idea is, I would have a flag before giving the access to the commuinty. If flag=true, he/she should get to home screen. If not, I should get an email.
Is this configurable without VF pages?
Thanks.
After a long research by myself, I found this Apex documentation which fulfills my basic requirement.
Please go through this link:
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_forcecom_email_outbound.htm
This all I needed.
And this material might be helpful to someone who has the same requirement as mine.
Thanks,
Sammy
send email through apex
your answer here
Please go through this link:
https://supportsalesforce.blogspot.com/2022/08/email-send-through-apex-class.html
let me know if this help you.
Happy to help You!
Thanks,
Anshul
Please refer to this (https://www.cloudwaale.com/post/how-to-send-email-from-apex-class) blog, here you will get step by step guide with examples.
Thanks,
Amol, www.cloudwaale.com