You need to sign in to do that
Don't have an account?

How to send email on custom button
Hi all,
I want to send an email as well as pdf which contain the fields of contacts whenever user click on custom send email button.
I want to send an email as well as pdf which contain the fields of contacts whenever user click on custom send email button.
Please try the below code:
Regards,
Khan Anas
All Answers
Greetings to you!
Below is the sample code which I have tested in my org and it is working fine. Kindly modify the code as per your requirement.
Visualforce: ConPdfEmail
Controller:
Visualforce: ConPdfEmail1
Create a custom detail page button using ConPdfEmail1 visualforce page and add it to page layout.
Please refer to the below link which might help you further with the above requirement.
https://developer.salesforce.com/forums/?id=9060G000000Xj73QAC
I hope it helps you.
Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.
Thanks and Regards,
Khan Anas
http://sfdcmonkey.com/2017/01/03/send-email-lightning-component/
Your code is working correctly but can you help me on this part.
It should fetch email address from the custom field and send email to that email address whenever i click on the "send email" button.
Please try the below code:
Regards,
Khan Anas
The code is not working and also it is not giving any error.
Right now when i Click on the button it is moved to the ConPDFEmail1 page without giving any error.
Regards,
Khan Anas
Can you help me same thing for lightning side also?
I have replied with sample code to your new question (send an email with attached PDF in lightning) which you have posted on forums:
https://developer.salesforce.com/forums/ForumsMain?id=9062I000000IF7BQAW
Regards,
Khan Anas