Thursday, January 17, 2013
OrgWideEmailAddress Used to Send the Email Using our own Mail ID
//Set Own Email address as From address as well as Reply to Email
1) Go to Administration setup -> Email Administration ->Org Wide Email Address
2) Add New Email Address with Name in Org Wide Email Address
ex
Display Name :Raja
Email :xxx@gmail.com
3)Then go to Send Email Code Part
Sample Code
OrgWideEmailAddress[] owea = [select Id from OrgWideEmailAddress where Address = 'xxx@gmail.com'];
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new String[]{emailLead.Email};
mail.setOrgWideEmailAddressId(owea.get(0).Id);
mail.setToAddresses( toAddresses );
mail.setSubject('Welcome to xxx!');
StaticResource[] leadEmailNormalTemp = [SELECT Id, Body FROM StaticResource WHERE Name = 'LeadEmailTemplate'];
StaticResource[] leadEmailMobileTemp = [SELECT Id, Body FROM StaticResource WHERE Name = 'LeadMobileEmailTemplate'];
mail.setHtmlBody((leadEmailMobileTemp[0].Body).toString());
newMail.add(mail);
Subscribe to:
Post Comments (Atom)
Salesforce - Generate dynamic inner query to fetch parent and related child records
Use Case: In many scenarios, we need to clone the records with related child records. Issue / Limitation: We may simply use the "cl...
-
<apex:page showHeader="false" sidebar="false" controller="ControllerName" standardStylesheets="fals...
-
<script> function myFunction() { var str = "IF((4+2)==5,true,false)"; str = str.replace(/\s/g, '');...
-
Use Case: In many scenarios, we need to clone the records with related child records. Issue / Limitation: We may simply use the "cl...
No comments:
Post a Comment