function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ken_KoellnerKen_Koellner 

Email from address on Sites app written in VF/Apex.

I have a real small sites app that was written in VF by another developer.

The controller uses Apex Messaging.sendEmail to send an email. The from email address is coming from a specific user's email address as if  the sendng user is hard-coded somewhere but I don't know where.  it's not in the Apex code.

 

The  setSenderDisplayName() and setReplyTo() methods are used to set those options and they come out okay.  But the actual from address isn't/can't be set with method calls.  The documentation says it comes from the current user.  I'm not sure what the user would be in the context of a Sites app.  I checked the Site Contact on the site configuration and changed it but that's not it.

 

So this email is still being sent from some hard-coded User's address.  I can't find it anywhere.

 

Any clue where it might be coming from?

 

sfdcfoxsfdcfox

I believe it should be from the Site User (Setup > Develop > Sites > SIte Name > Public Access Settings > View Users). I've never had to answer that question (yet), so I might be off the mark on this one.