Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Add In-Memory Data as Email AttachmentDownloads: MS Windows Visual C/C++ Libraries Linux/CentOS C/C++ Libraries MAC OS X C/C++ Libraries Solaris C/C++ Libraries C++ Builder Libraries How to add an email attachment directly from in-memory data. // Add in-memory data as an attachment to an email.
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;
email.put_Body("This is a test");
email.put_Subject("This is the subject.");
email.put_FromName("Bob");
email.put_FromAddress("bob@chilkatsoft.com");
email.AddTo("Chilkat Support","support@chilkatsoft.com");
const char *myText = "This will by my text file attachment\nEmail is easy!\n";
email.AddDataAttachment("MyText.txt",(const unsigned char *)myText,strlen(myText));
if (!mailman.SendEmail(&email))
{
// We could send the email in-process:
mailman.SaveLastError("errors.xml");
}
}
|
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.