Message.ToMailMessage Method

OpenPop.NET

OpenPop.NET POP3 Library Documentation

Message.ToMailMessage Method

This method will convert this Message into a MailMessage equivalent.
The returned MailMessage can be used with SmtpClient to forward the email.

You should be aware of the following about this method:

  • All sender and receiver mail addresses are set. If you send this email using a SmtpClient then all receivers in To, From, Cc and Bcc will receive the email once again.
  • If you view the source code of this Message and looks at the source code of the forwarded MailMessage returned by this method, you will notice that the source codes are not the same. The content that is presented by a mail client reading the forwarded MailMessage should be the same as the original, though.
  • Content-Disposition headers will not be copied to the MailMessage. It is simply not possible to set these on Attachments.
  • HTML content will be treated as the preferred view for the Body. Plain text content will be used for the Body when HTML is not available.

public MailMessage ToMailMessage();

Return Value

A MailMessage object that contains the same information that this Message does

See Also

Message Class | OpenPop.Mime Namespace