title: Sending an email with the header return-path using windows virtual mail server
body: <p>I'm trying to send an email message using the .NET MailMessage class which can also have the return-path header added so that any bounces come back to a different email address. Code is below:</p>
  
  <pre><code>MailMessage mm = new MailMessage(
      new MailAddress(string.Format("{0}&lt;{1}&gt;", email.FromName, email.FromEmail)), 
      new MailAddress(emailTo));
  
  mm.Subject = ReplaceValues(email.Subject, nameValues);
  mm.ReplyTo = new MailAddress(string.Format("{0}&lt;{1}&gt;", email.FromName, email.FromEmail));
  mm.Headers.Add("Return-Path", ReturnEmail);
  
  // Set the email html and plain text
  // Removed because it is unneccsary for this example
  
  // Now setup the smtp server
  SmtpClient smtp = new SmtpClient();
  smtp.Host = SmtpServer;
  smtp.DeliveryMethod = SmtpDeliveryMethod.PickupDirectoryFromIis;
  
  if (SmtpUsername.Length &gt; 0)
  {
      System.Net.NetworkCredential theCredential = 
          new System.Net.NetworkCredential(SmtpUsername, SmtpPassword);
      smtp.Credentials = theCredential;
  }
  
  smtp.Send(mm);
  </code></pre>
  
  <p>Whenever I check the email that was sent I check the header and it always seems to be missing return-path. Is there something I am missing to configure this correctly? As I said above I'm using the standard Virtual Mail Server on my development machine (XP) however it will run on Windows 2003 eventually.</p>
  
  <p>Has anyone got any ideas why it isn't coming through?</p>