You need to sign in to do that
Don't have an account?
Getting problem with setReplyTo property for sending email
hi
when i setReplyTo property also i am unable to get the from address.
My code is like this:
Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
email.setTemplateId(objEmailTemplate.Id);
email.setReplyTo('padmavathi@appshark.com');
email.setSenderDisplayName('Appointment Confirmation');
email.setTargetObjectId(objContact.id);
email.setSaveAsActivity(false);
email.setWhatId(AppointmentId);
Messaging.SendEmailResult [] r = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
but still default login salesforce user email address is coming when i click on Reply.
please help me
All Answers
Hi I tried to use without template too , but its still not working , when I hit the reply it goes to admin email Id :
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(new String[] {'myemail@gmail.com'});
mail.setReplyTo('test@gmail.com');
mail.setSenderDisplayName('Batch Processing');
mail.setSubject('Batch Process Completed');
mail.setPlainTextBody('Batch Process has completed');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
Any Idea ?