Gets or sets charset of the message.
The name of the character set the message is composed with. The default value is an empty string.
This property is equivalent to Charset property of Message object.
If no charset is specified in the message, mail reader program of the message recipient will use the default system charset to display the message.
Note Some mail servers add charset setting to the message if it has no charset specified. This may cause the message to be displayed incorrectly. To avoid this, always specify Charset property if the message contains non-US characters.
Setting Windows-1251 charset for the message composed in Russian.
[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(); // Indicate the message uses Cyrillic charset. mailer.Charset = "windows-1251"; // "The message subject" in Russian (note that using MailMessage.GetEncodedHeaderValue // is not necessary, since charset is set for entire message in Charset property). // MailMessage.GetEncodedHeaderValue is required when charset of the message // differs from charset of the header value. mailer.Subject = "Тема сообщения"; // "The message body" in Russian. mailer.BodyPlainText = "Тело сообщения";
[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 ' Indicate the message uses Cyrillic charset. mailer.Charset = "windows-1251" ' "The message subject" in Russian (note that using MailMessage.GetEncodedHeaderValue ' is not necessary, since charset is set for entire message in Charset property). ' MailMessage.GetEncodedHeaderValue is required when charset of the message ' differs from charset of the header value. mailer.Subject = "Тема сообщения" ' "The message body" in Russian. mailer.BodyPlainText = "Тело сообщения"
Smtp Class | MailBee.SmtpMail Namespace