Quantcast
Channel: SharePoint 2010 - Development and Programming forum
Viewing all articles
Browse latest Browse all 11571

Does Event Receiver send email from the account of user running the code? - SharePoint 2010 - Visual Studio 2010

$
0
0

Hi,

I use SharePoint 2010 and an ER (event receiver) built in VS (Visual Studio) on ItemAdded event.
The ER runs on a custom list.

I use SPUtility.SendEmail (the headers do NOT have FROM address)

           StringDictionary headers = new StringDictionary();
           headers.Add("to", "JohnSmith@company.com");
           headers.Add("subject", " Test subject ");
           SPUtility.SendEmail(properties.Web, headers, " Test body ");

I thought FROM address (in above email) should be same as the one I configured in Central Admin > System Settings > Outgoing E-Mail Settings > From address.
Still to my surprise the email is sent FROM the email of the user adding this item?

Is this expected behavior? Am I making any mistake? I believe the email should be sent from the address configured in central admin?

Thanks all.






Viewing all articles
Browse latest Browse all 11571

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>