MailBee.NET Objects 3.1

Smtp.Subject Property

Gets or sets the subject of the message.

public string Subject {get; set;}

Property Value

The string containing the subject of the message.

Remarks

This property is equivalent to Subject property of Message object.

Example

Specifying message subject in normal way and in encoded form (useful if the subject string contains non-US characters).

[C#]
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.SmtpMail;
using MailBee.Mime;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();

// "Hello" in English.
mailer.Subject = "Hello";

// "Hello" in Simplified Chinese (gb2312 charset).
mailer.Subject = MailMessage.GetEncodedHeaderValue("Subject", "你好",
    System.Text.Encoding.GetEncoding("gb2312"), HeaderEncodingOptions.Base64);
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code.
Imports MailBee
Imports MailBee.SmtpMail
Imports MailBee.Mime

' The actual code (put it into a method of your class)

Dim mailer As New Smtp

' "Hello" in English.
mailer.Subject = "Hello"

' "Hello" in Simplified Chinese (gb2312 charset).
mailer.Subject = MailMessage.GetEncodedHeaderValue("Subject", "你好", _
    System.Text.Encoding.GetEncoding("gb2312"), HeaderEncodingOptions.Base64)

See Also

Smtp Class | MailBee.SmtpMail Namespace