troubleshooting Question

Set MAIL FROM (Return-Path:) without setting Sender: header in email

Avatar of N1njaB0b
N1njaB0bFlag for United States of America asked on
.NET Programming
3 Comments1 Solution1260 ViewsLast Modified:
I am writing a .NET application that will send out thousands of email notifications (no, not spam) on behalf of our clients. I am (currently) planning on sending these through an Exchange server, and that requires NTLM authentication, so I have chosen System.Net.Mail.SmtpClient as my class.

In order to track the bounces for our client, I need to ensure that the Return-Path: header reflects our email address, (while of course the From: header reflects our client's address).  This is done by setting the MailMessage.Sender property.  The problem is, in addition to using that as the MAIL FROM, it also adds a "Sender:" header to the email.  The side-effect of this Sender: header is that now the email reads as "From: <venderemail> ON BEHALF OF <clientemail>".  This of course is not what the client wants.  The email should appear to come from them.

I know that this can legitimately be done, because I've tested it using telnet and constructing my own message.  I just need a .NET class to do it so it can handle the NTLM authentication and mime encoding, etc..

If possible I don't want to have to purchase a third party piece of software, and as I've stated I would also like to avoid writing my own SMTP client.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 3 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros