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

 

 

 

 

 

 

 

 

Add In-Memory Data as Email Attachment

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

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.

Mail Component · .NET Mail Component · XML Parser