14

I have been received a lot of emails "on behalf on". For example, the AddThis plugin sending a email from "addThis.com on behalf of myfriend@gmail.com".

How do I do this in C#/ASP.NET? Also, does this work if we use gmail for our SMTP, albeit branded to our company domain?

I'm also wondering if there are any concerns about this being unprofessional or getting flagged as spam on the client PC? In other words, have you guys actually implemented this...

CJ-BehalfOf
  • 141
  • 1
  • 1
  • 3

2 Answers2

24

You have three properties in the MailMessage class:

  • From
  • Sender
  • ReplyTo (or in .NET 4 the ReplyToList)

If you set the Sender different than the From, it should behave as you want it.

Please also see this SO posting for other aspects.

Community
  • 1
  • 1
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
0

This is primarily a client app "feature". I'm guessing that you are viewing these email messages in Outlook, correct? Outlook (and possibly other email clients) compare the FROM address and the actual sender to see if they match. If they don't, Outlook will display the "On Behalf Of" information.

Most other email clients, and all web-based clients that I know of, simply display the "FROM" address as it was provided.

Flipster
  • 4,373
  • 4
  • 28
  • 36