Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Send a Vietnamese Email This C++ program creates and sends an email in Vietnamese. // Send Vietnamese 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 Vietnamese text.
// The Vietnamese text is: Tôi có thể ăn thủy tinh mà không hại gì.
CkString str;
str.loadFile("vietnamese.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");
// Vietnamese 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:35:15 -0500
Message-ID: <CHILKAT-MID-ed43b621-85d1-4efd-b530-1d413a91a5fc@DotNetDev>
X-Mailer: Chilkat Software Inc (http://www.chilkatsoft.com)
X-Priority: 3 (Normal)
Content-Transfer-Encoding: base64
subject: =?utf-8?B?VMO0aSBjw7MgdGjhu4MgxIM=?=
=?utf-8?B?biB0aOG7p3kgdGluaCA=?=
=?utf-8?B?bcOgIGtow7RuZyBo4bqhaQ==?=
=?utf-8?B?IGfDrC4=?=
To: "Chilkat Support" <support@chilkatsoft.com>
From: "Matt" <matt@chilkatsoft.com>
return-path: matt@chilkatsoft.com
Content-Type: text/plain; charset="utf-8"
77u/VMO0aSBjw7MgdGjhu4MgxINuIHRo4buneSB0aW5oIG3DoCBraMO0bmcgaOG6oWkgZ8Os
Lg==
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.