You need to sign in to do that
Don't have an account?
Kannan.Ram
Sender Address in Apex Email
Hi,
Is it possible to dynamically set the Sender Address on an email when using a SalesForce Email Template in Apex?
Thanks,
Kannan
function readOnly(count){ }
You need to sign in to do that
Don't have an account?
Hi,
Is it possible to dynamically set the Sender Address on an email when using a SalesForce Email Template in Apex?
Thanks,
Kannan
Hi Kannan,
Here is a snippet that may help you:
This example uses more mail methods.
To read more:
http://www.salesforce.com/us/developer/docs/apexcode/index.htm
and search for mail.
Hope it helps,
Bruno
Thanks Bruno. This is my code snippet :-
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setTemplateId(templateId);
mail.setTargetObjectId(leadId);
//mail.setOrgWideEmailAddressId(mailId);
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
I get an error saying that the setOrgWideEmailAddressId method is incorrect or does not exist. I've tried all possible combinations but it does not accept anything.
Any idea how I can make this work?
Thanks,
Kannan
I'm getting the same error... did you ever find a solution to this?
I found the reason: The APEX class that I was modifying was created a while ago and had an APEX version number of 14... but that was prior to "organizational emails" -- I changed the APEX version of the code (in the MetaData) to 19, and now it works OK.
:Paul
Yes, I think the functionality was a Summer '09 release. Any Metadata version above 17 should work.