Last post Jun 04, 2011 08:32 AM by joejr
Jun 02, 2011 12:52 PM|joejr|LINK
I just added a post to the SQL forum hoping to find a solution in sql mail but am not confident solution can be found there so am hoping someone in this forum can help. The company I work for has an application where various users can log in and add their
own "clients". Currently, via sql mail a confirmation email goes out to the client who has been added but the "From" value is generic i.e.
Admin@CompanyA.com. What we need is a way for an email message to be sent to the new client but have the "From" email be that of the user adding the new client. When a user registers to use our system they supply basic
info including their email, so when they log in and then add a client we would like to have an email sent to that client but have the "From" address be that of the logged in user instead of the generic one from our company. The email would have to be sent
from our company's server but we want the sendee to be able to directly "reply" to the sender's email. Any suggestions would be greatly appreciated.
Jun 02, 2011 01:01 PM|DarrellNorton|LINK
If you are using an ASP.NET Membership Provider, the logged in user's email can be found using:
So you would set the FROM email like this:
myMailMessage.From = Membership.GetUser().Email;
Jun 04, 2011 08:32 AM|joejr|LINK
Thanks Darrell, I found a sql solution which for now is preferable but your response got me looking into "Membership" which I hadn't considered before.