Charset Property


Specifies the character set that was used for composing the message.

This property makes sense only when you create the message yourself. If the message was created by MailBee (returned by MailBee.POP3 object), the message is already decoded to Windows charset, so this property will be empty.

You can leave it empty (us-english charset assumed).

Note: If message body (BodyText) has alternative version (AltBodyText), they both must be composed with the same charset.


Value Type: String
Parameters: None 
Remarks: If the message was received using MailBee.POP3 object, you cannot change this property unless Message.Locked property is set to False

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-2010, AfterLogic Corporation. All rights reserved.