Archived Forum Post

Index of archived forum posts


Sending Email using International Character Sets

Jun 14 '12 at 17:25

This is a question from a customer today: I wanted to inquire about sending emails that use international character sets. With "Chilkat Mail" allow for this? I saw you have a different component named "Charset" and I'm just trying to figure out if we'd need that as well.


You wouldn't need the "Chilkat Charset" component to send email using any charset. Given that your programming language is .NET, all strings passed to the Chilkat .NET methods, and strings returned by the Chilkat .NET methods are .NET string objects capable of holding characters in any language (Chinese, Japanese, Hebrew, Polish, etc.) You really don't need to worry about character encoding when using string objects.

That being said, let's say you want to send a Chinese email. You set the email.Subject property equal to a string containing Chinese characters, and you might also set the email.Body property to a string containing Chinese characters. Chilkat will automatically recognize that 8bit chars are involved and will choose "utf-8" as the character encoding used for the email when the MIME is generated and sent. Let's say you wanted the email to be sent using MIME where the text is represented using big5 or gb2312. You only need to tell the email object by setting the email.Charset property equal to "big5" or "gb2312". When the email is sent, the subject, body text, etc. will be encoded using these charsets.

Likewise, when receiving email, you never need be concerned about the character encoding used in the raw MIME source of the email. Chilkat automatically handles conversions, and for any method or property returning a string, it is a string object containing the correct characters.