You need to sign in to do that
Don't have an account?
sumiran123
Setting up of From address in Email.Urgent
Hi,
We have an email messaging class Messaging.SingleEmailMessage for sending custom emailsWe need to configure the From email Address,and we are not able to find any such property that we can set the "From" address in Messaging.SingleEmailMessage object.
Kindly provide the solution as soon as possible!!
Thanks.
Sumiran,
Have you tried these properties?
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setReplyTo('someuser@somewhere.com');
// Specify the name used as the display name.
mail.setSenderDisplayName('Salesforce Support');
Hi Frodo,
I have tried the same and well it does not set the from address.When I click on reply the reply address is set.The from address is still a problem.
In email the Reply-To and the From are not the same thing. By setting the Reply-To to something like monitoredbox@acme.com that is where the email goes when someone hits reply.
What is being asked for here, and I need the same, is for the From address to also be configurable. Right now there appears to be no way to set this. SenderDisplay name is the friendly part of the From address and Reply only displays after someone hits reply.
For example
$singleEmail = new SingleEmailMessage();
$singleEmail->setSenderDisplayName("Friendly Service Center");
$singleEmail->setReplyTo("monitoredbox@mycompany.com");
Will yield an email like this...
From: "Friendly Service Center" [myaccount@mysalesforcedomain.com]
That will switch to this when reply is hit...
To: monitoredbox@mycompany.com
In my particular case I am using the Outbound Message triggered in a workflow, to invoke a SOAP service at on my side, to turn around and invoke sendEmail. The FROM address defaults to the account of the user credentials provided, or the account of the send-as-user on the Outbound Message if using the session id.
Any ideas on how to get around this?