Visual C++ Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
DH Key Exchange
DKIM/DomainKeys
Digital Certificates
Digital Signatures
DSA
Email
Email Object
Encryption
FTP
HTML Conversion
HTTP
IMAP
MHT / HTML Email
POP3
RSA
S/MIME
SMTP
Socket
Spider
SSH Key
SSH
SSH Tunnel
SFTP
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

 

 

Send Japanese Mail

Downloads:

MS Windows Visual C/C++ Libraries
Linux/CentOS C/C++ Libraries
MAC OS X C/C++ Libraries
Solaris C/C++ Libraries
C++ Builder Libraries

C++ source code to send Japanese email.

// C++ Code to Send Japanese Mail
void EmailExample(void)
    {
    CkMailMan mailman;

    // Any string passed to UnlockComponent begins the 30-day trial.
    bool unlocked = mailman.UnlockComponent("30-day trial");
    if (!unlocked)
	{
	printf("Failed to unlock component\n");
	return;
	}

    mailman.put_SmtpHost("mail.earthlink.net");
    
    CkEmail email;

    // Load a utf-8 text file containing Japanese text.
    // The Japanese text is: 私はガラスを食べられます。
    CkString str;
    str.loadFile("japanese.txt","utf-8");

    // Set the email's multibyte string mode to "utf-8"
    // After doing this, all "const char *" method arguments expect
    // utf-8 strings.
    email.put_Utf8(true);

    email.put_Body(str.getUtf8());

    email.put_Subject(str.getUtf8());

    email.AddTo("Chilkat Support","support@chilkatsoft.com");

    email.put_FromName("Matt");
    email.put_FromAddress("matt@chilkatsoft.com");

    // We can explicitly set the charset by setting the Charset property.
    // However, Chilkat is smart in that it automatically recognizes the
    // Japanese characters and sets the charset appropriately.
    // email.put_Charset("Shift_JIS");
    // email.put_Charset("iso-2022-jp");
    // email.put_Charset("euc-jp");

    // Send the email
    if (!mailman.SendEmail(&email))
	{
	mailman.SaveLastError("errors.xml");
	}

    }

****
The MIME source of the email created by this program is:

MIME-Version: 1.0
Date: Fri, 20 Aug 2004 11:09:59 -0500
Message-ID: <CHILKAT-MID-7110c146-30e6-448f-8a56-5aed4a166be0@DotNetDev>
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
X-Priority: 3 (Normal)
Content-Type: text/plain; charset="shift_jis"
Content-Transfer-Encoding: base64
subject: =?shift_jis?B?joSCzYNLg4mDWILwkEiC14LnguqC3IK3?=
	=?shift_jis?B?gUI=?=
To: "Chilkat Support" <support@chilkatsoft.com>
From: "Matt" <matt@chilkatsoft.com>
return-path: matt@chilkatsoft.com

joSCzYNLg4mDWILwkEiC14LnguqC3IK3gUI=

 

 

 

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Mail Component · XML Parser