MailMessageReturnPath Property |
Namespace: MailBee.Mime
The mail server which transmitted the message may add this header to specify the email address of the original sender of the mail message. If the message was never sent, this property will contain an empty string. With TimeStamps property (which represents Received headers), ReturnPath provides trace route information about the message.
You cannot set ReturnPath directly (because it's set by the mail server, not by MailBee). However, if you need to send a message from the address different from From address, you can pass it as senderEmail parameter value of Send(String, String) method. In this case, the mail server will set Return-Path header to senderEmail value, not to From value.
// To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.Mime; // The actual code (put it into a method of your class) // Load the message from file. MailMessage msg = new MailMessage(); msg.LoadMessage(@"C:\Docs\TestMail.eml"); // Show the return path of the message. Console.WriteLine("The return path is " + msg.ReturnPath);