MailBee.NET Objects 4.0

MailMessage.Importance Property

Gets or sets the importance of the message.

public MailPriority Importance {get; set;}

Property Value

The importance of the message, or None if not specified. The default value is None.

Remarks

The importance of the message is taken from Importance header.

To get or set the message priority (rather than the message importance), use Priority property. It's common practice to set both Priority and Importance properties. Some e-mail clients do not support Importance or Priority but still support one of these fields. Thus, if you specify both, all e-mail clients will be able to understand at least one of the fields.

Example

This sample sends a message only if it's very important.

[C#]
using MailBee;
using MailBee.SmtpMail;
using MailBee.Mime;

class Sample
{
    static void Main(string[] args)
    {
        // Load the message from file.
        MailMessage msg = new MailMessage();
        msg.LoadMessage(@"C:\Docs\TestMail.eml");

        // Send the message if it's very important.
        if (msg.Importance == MailPriority.Highest)
        {
            Smtp.QuickSend(msg);
        }
    }
}
[Visual Basic]
Imports MailBee
Imports MailBee.SmtpMail
Imports MailBee.Mime

Module Sample
    Sub Main(ByVal args As String())
        ' Load the message from file.
        Dim msg As New MailMessage
        msg.LoadMessage("C:\Docs\TestMail.eml")

        ' Send the message if it's very important.
        If msg.Importance = MailPriority.Highest Then
            Smtp.QuickSend(msg)
        End If
    End Sub
End Module

See Also

MailMessage Class | MailBee.Mime Namespace | Priority