aspNetEmail

EmailMessage.XHeaders Property

A NameValue collection of XHeaders.

public System.Collections.Specialized.NameValueCollection XHeaders {get; set;}

Example

[C#]
            	 EmailMessage msg = new EmailMessage( "mail.myCompany.com");
            msg.Subject = "Order Confirmation";
            msg.To = "you@yourcompany.com";
            
            msg.From = "me@myCompany.com";
            
            //logging for easier troubleshooting
            msg.Logging = true;
            msg.LogPath = "c:\\email.log";
            
            //set the plain text body
            msg.Body  = "the email body contents go here...";
            
            //set the X-Mailer
            msg.XMailer = "Acme Mailer 1.0";
            
            //add X-Headers
            msg.XHeaders = new NameValueCollection();
            msg.XHeaders.Add( "X-Company", "Acme Corp" );
            msg.XHeaders.Add( "X-Campaign", "1990XYKSX92" );
            
            msg.Send();
            
[VB.NET]
            
            	 Dim msg As New EmailMessage("mail.myCompany.com")
            msg.Subject = "Order Confirmation"
            msg.To = "you@yourcompany.com"
            
            msg.From = "me@myCompany.com"
            
            'logging for easier troubleshooting
            msg.Logging = True
            				  msg.LogPath = "c:\email.log"
            
            'set the plain text body
            msg.Body = "the email body contents go here..."
            
            'set the X-Mailer
            msg.XMailer = "Acme Mailer 1.0"
            
            'add X-Headers
            msg.XHeaders = New NameValueCollection()
            				   msg.XHeaders.Add("X-Company", "Acme Corp")
            msg.XHeaders.Add("X-Campaign", "1990XYKSX92")
            
            msg.Send()
            

See Also

EmailMessage Class | aspNetEmail Namespace