Charset Property


Specifies the character set of the message.

This property mostly makes sense only when you create the message yourself. If the message was created by MailBee (such as returned by MailBee.POP3 object), the message is already decoded to Unicode, so this property value will be informational only.

The default value for new messages is "utf-8".

Note that if you receive HTML e-mail and plan to display it in the browser, you will usually need to remove META tag containing charset declaration from the HTML body. This is because MailBee uses the charset declaration from the e-mail headers to decode the HTML body into Unicode, and the charset META charset becomes no longer relevant (because HTML body is now Unicode). From now on, if you display the HMTL contents in a browser, META charset declaration must not be there (otherwise, the browser will use it and set the charset of the page incorrectly).

You can use RemoveCharsetFromBody method to remove this charset declaration from the HTML body.


Value Type: String
Parameters: None 

Usage example:

Dim Mailer
'Using visual basic to create object
Set Mailer = CreateObject("MailBee.SMTP")
'Using ASP to create object
'Set Mailer = Server.CreateObject("MailBee.SMTP")
'In ASP use Response.Write instead of MsgBox
Mailer.LicenseKey = "put your license key here"
Mailer.ServerName = "mail.server.com"
If Mailer.Connect Then
  Mailer.Message.ToAddr = "bill@yoursite.com"
  Mailer.FromAddr = "Natasha <nata@server.com>"
  Mailer.Subject = "Non-english text in the subject and in the body"
  Mailer.Charset = "koi8-r"
  Mailer.ImportBodyText "C:\docs\letter_koi8.htm", True
  Mailer.MakeAltBody
  Mailer.Send
  Mailer.Disconnect
End If

See Also:

BodyText Property
AltBodyText Property
BodyEncoding Property
AltBodyEncoding Property


Copyright © 2002-2022, AfterLogic Corporation. All rights reserved.