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
NIKHIL_SFDCNIKHIL_SFDC 

Create a button on detail page to send an email.

Hello everyone,

 

I want to create a button on case detail page next to edit button, so that it should open in the outlook with some constant email address in To (for ex support@gmail.com should always in To).

 

I am trying this code in custome button but this is not working.

<a href="mailto:support@gmail.com">Email Me</a>


Please help me.

 

Thanks,

Nikhil

Best Answer chosen by Admin (Salesforce Developers) 
bermager@gmail.combermager@gmail.com

OnClick JavaScript;

 

Code:

window.open("mailto:support@gmail.com","_self")

 

this will work.

All Answers

bermager@gmail.combermager@gmail.com

OnClick JavaScript;

 

Code:

window.open("mailto:support@gmail.com","_self")

 

this will work.

This was selected as the best answer
sandeep@Salesforcesandeep@Salesforce

For this you need to use a custrom button field (Text type) .Please write a href over this formula field to redirect it to some other VF page and there onload you can implement your logic.

Tejpal KumawatTejpal Kumawat

Hi Nikhil,

 

There are two way to create custom button on case detail page for Email:

 

1. First way : Create 'Email Me' Custom button & Link it with a VF Page that open a popup Page for email , this is best way.

 

2. Second way : some configuration But have many options :)

a) Create a hierarchy Custom setting like Name as "Configuration Custom setting" and add New Field Like Name as "Support Contact Id[Text(18)]".

b) Create New Conact Like Name as "Support Contact" and put Email address as "support@gmail.com" and also fill your required field values.

c). Copy the Contact Id from Url

d). Go to  "Configuration Custom setting" -> Click on Manage Link -> Click on New button above "Default Organization Level Value" Section -> Paste the contact Id in "Support Contact Id[" Field.

e.) Now Create 'Email Me' Custom button for detail Page and put this Java Script :

 

window.open("/_ui/core/email/author/EmailAuthor?p3_lkid={!Case.Id}&retURL={!Case.Id}&p2_lkid={!$Setup.Configuration_Custom_setting__c.Support_Contact_Id__c}&p6=Case Email to Support")

 

If any issues please let me know?

vunnam divyavunnam divya
Hii ,plz help me 
1.Create a custom button sendEmail on invoice detail page. 2.when we click on button , Email should be sent to the manager of the user who prepared Invoice record.
I am stuck this