1

An external developer created apex to send an email to users when a form is submitted. The email works, but the sender email address that shows in the email appears to be the developer's email. I don't know how to change this. The correct ReplyTo address is set and the correct Sender DisplayName shows, but the developer's email address appears as the sender's email when you look closely at it. Also, the guy's picture shows up in Gmail with the message because he has that type of address. I don't want my users to see a person's picture that doesn't work at our company.

Email method from comments:

Messaging.SingleEmailMessage mailToSend = new Messaging.SingleEmailMessage(); 
mailToSend.setToAddresses(emailsAddress); 
mailToSend.setReplyTo('[email protected]'); 
mailToSend.setSenderDisplayName('NIIMBL'); mailToSend.saveAsActivity = false; 
mailToSend.setSubject('Membership Information'); 
mailToSend.setPlainTextBody('Thank you for contacting NIIMBL! A member of the 
NIIMBL team will contact you shortly.'); Messaging.sendEmail(new 
Messaging.SingleEmailMessage[] {mailToSend}); 
12
  • 1
    Is it a scheduled job? More detail is needed here.
    – Adrian Larson
    Commented Jul 8, 2018 at 5:57
  • 2
    salesforce.stackexchange.com/questions/122253/…
    – Eric
    Commented Jul 8, 2018 at 7:36
  • This is not a scheduled job. It is apex that is run when a form is submitted. I just set an OWD address & it wasn't used by the code. Below is a key piece of the code. Let me know if you need more. Commented Jul 8, 2018 at 12:01
  • Not sure how to paste chunk of code that is large...working on it. Commented Jul 8, 2018 at 12:02
  • 1
    Pasting code or any further details directly related to the question is not recommended. Please have your question edited to reflect all these details so that it helps everyone.
    – Jayant Das
    Commented Jul 8, 2018 at 14:01

1 Answer 1

0

Created an OWD email address & set it in my code before sending the email. It is still interesting that it appears the original developer's email is used if an OWD is not set.

1
  • If your form is being submitted via some kind of web service integration, that external system may be authenticating as your original developer, making him/her the running user when the email send goes off.
    – David Reed
    Commented Jul 18, 2018 at 19:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .