+ Start a Discussion
SFDC_BigDogSFDC_BigDog 

Sending Email using custom button not working

I have tried this code for custom button for single click email sending. Unfortunately It is not working and showing error. Could anyone tell me where I am doing wrong and correct me please.

Thank you.
location.replace('/email/author/emailauthor.jsp retURL=/{!Opportunity.Id}&p24="varunreddypenna@gmail.com,v.reddy@thegordiangroup.com"&template_id="00Xj0000000J8sI"&p3_lkid={!Opportunity.Id}&p3={!Opportunity.Name}&p26={!User.Email}&p5="penna.janareddy@gmail.com"&save=0')
User-added image
User-added image

 
Best Answer chosen by SFDC_BigDog
JayNicJayNic
location.replace('/email/author/emailauthor.jsp retURL=/{!Opportunity.Id}&p24=varunreddypenna@gmail.com,v.reddy@thegordiangroup.com&template_id=00Xj0000000J8sI&p3_lkid={!Opportunity.Id}&p3={!Opportunity.Name}&p26={!User.Email}&p5=penna.janareddy@gmail.com&save=0')

Well, jsut at a cursory glance: you have quotes around some of your parameters, Remove those, and give it a try. I didn't test this - just what I saw.

All Answers

JayNicJayNic
location.replace('/email/author/emailauthor.jsp retURL=/{!Opportunity.Id}&p24=varunreddypenna@gmail.com,v.reddy@thegordiangroup.com&template_id=00Xj0000000J8sI&p3_lkid={!Opportunity.Id}&p3={!Opportunity.Name}&p26={!User.Email}&p5=penna.janareddy@gmail.com&save=0')

Well, jsut at a cursory glance: you have quotes around some of your parameters, Remove those, and give it a try. I didn't test this - just what I saw.
This was selected as the best answer
SFDC_BigDogSFDC_BigDog

Hey Jaynic,

I did try and it did work. But it is popping up a window where I have to enter "To address" email id and then click send. How to auto populate to address field using this code?

justin_sfdcjustin_sfdc

Hi there,
Just a thought! Why don't you use workflow email alert. You could have a checkbox field; name it as "Send Email" to send the emails out or even the button which will check this box so that the emails are sent out.
 

Thanks!