MailMessageContentType Property
Gets the content type of the message.

Namespace: MailBee.Mime
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public string ContentType { get; }

Property Value

Type: String
A string containing the content type of the mail message. The default value for a new message is text/plain.
Remarks

The value of this property is taken from the Content-Type header. The typical content types are:

  • text/plain
  • text/html
  • text/calendar
  • multipart/alternative
  • multipart/mixed
  • application/x-zip-compressed
If the content-type is missing in the message being parsed, this property will return an empty string.

You do not need to manually set the content-type of the message. It will be set automatically depending on the structure of the message (e.g. its text bodies and attachments).

Examples
This sample downloads the first message from the specified POP3 account and displays the content type of the message.
using System;
using MailBee;
using MailBee.Pop3Mail;
using MailBee.Mime;

class Sample
{
    static void Main(string[] args)
    {
        // Quickly download the first message from the specified POP3 account
        MailMessage msg = Pop3.QuickDownloadMessage("pop3.mail.com", "dan_brown", "password", 1);

        // Show the content type of the message.
        Console.WriteLine("Content type is " + msg.ContentType);
    }
}
See Also