Visual C++ Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript



Visual C++ Examples

CkString
Byte Array
Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Encryption
FTP
HTML-to-XML
HTTP
IMAP
MHT / HTML Email
RSA
S/MIME
Socket
Spider
Tar
Upload
XML
XMP
Zip Compression


More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
SSH Key
SSH
SSH Tunnel
SFTP

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

 

 

 

 

 

 

 

Send a Hindi Email

This C++ program creates and sends an email in Hindi.

// Send Hindi Email in C++
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 Hindi text.
    // The Hindi text is: मैं काँच खा सकता हूँ, मुझे उस से कोई पीडा नहीं होती.
    CkString str;
    str.loadFile("hindi.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");

    // Hindi email is sent using the utf-8 character encoding.
    email.put_Charset("utf-8");

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

    }


*****
The MIME text of the email created and sent by this program is:

MIME-Version: 1.0
Date: Fri, 20 Aug 2004 11:44:34 -0500
Message-ID: <CHILKAT-MID-f85a523e-66b1-459b-9e54-ec9ef3716c6c@DotNetDev>
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
X-Priority: 3 (Normal)
Content-Transfer-Encoding: base64
subject: =?utf-8?B?4KSu4KWI4KSCIOCkleCkvuCkgeCkmiDgpJbgpL4g?=
	=?utf-8?B?4KS44KSV4KSk4KS+IOCkueClguCkgSwg4KSu4KWB?=
	=?utf-8?B?4KSd4KWHIOCkieCkuCDgpLjgpYcg4KSV4KWL4KSI?=
	=?utf-8?B?IOCkquClgOCkoeCkviDgpKjgpLngpYDgpIIg4KS5?=
	=?utf-8?B?4KWL4KSk4KWALg==?=
To: "Chilkat Support" <support@chilkatsoft.com>
From: "Matt" <matt@chilkatsoft.com>
return-path: matt@chilkatsoft.com
Content-Type: text/plain; charset="utf-8"

77u/4KSu4KWI4KSCIOCkleCkvuCkgeCkmiDgpJbgpL4g4KS44KSV4KSk4KS+IOCkueClguCk
gSwg4KSu4KWB4KSd4KWHIOCkieCkuCDgpLjgpYcg4KSV4KWL4KSIIOCkquClgOCkoeCkviDg
pKjgpLngpYDgpIIg4KS54KWL4KSk4KWALg==

 

 

 

Need a specific example? Send a request to support@chilkatsoft.com

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

Mail Component · .NET Mail Component · XML Parser