You need to sign in to do that
Don't have an account?

SetReplyTo for visualforce email template
hi
Can u please tell me how to set SetReplyTo option for an Visualforce email template. by default it takes the User email id. but i want to change the reply to email address. how can i do this. please help me
In the controller:
Declare the object:
public Messaging.SingleEmailMessage mailHandler = new Messaging.SingleEmailMessage();
Setting the replyto:
mailHandler.setReplyTo('test@sumit.com');
Hope it helps,
~Sumit
Here is an example in a visualforce email template:
<messaging:emailTemplate subject="test" replyTo="someone@acme.com" recipientType="contact" > <messaging:plainTextEmailBody > Congratulations! This is your new Visualforce Email Template. </messaging:plainTextEmailBody> <messaging:htmlEmailBody >fdsdf</messaging:htmlEmailBody> </messaging:emailTemplate>
Hi Rasmus,
This setting of replyTo attribute in emailTemplate tag isn't working for me, whatever be the email domain..i.e., gmail.com or yahoo.com or mycompany.com.
Is there any other setting we should be using to make it work?
Guys, Not sure if this helps you but one way is as follows:
Which seemed to do the trick for me in my email class. However I haven't managed to generalize it using a string variable read from an object field:
Hope this helps. (Sorry if you get a bunch of emails I had trouble pasting the code lines in).