C# Examples

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

C# Examples

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


More Examples...
Amazon S3
NTLM
FileAccess
RSS
Atom
String
Byte Array
Self-Extractor
Service
PPMD
Deflate
DH Key Exchange
DSA
Bzip2
LZW

 

 

 

 

 

 

message/rfc822 Attached Email

Download: Chilkat .NET Assemblies

C# example demonstrating how to access message/rfc822 attached messages within an email.

// Attached messages are complete emails embedded within another email.
// The Chilkat mail component provides methods and properties for
// accessing attached messages.  This example demonstrates how to
// retrieve each attached email message and save each to a file.

private void save_attached_messages(Chilkat.Email email)
{
    Chilkat.Email attachedEmail;
    string filename;
        
    int fnameIdx = 0;
    
    // Loop over each attached message contained within the email.
    int n = email.NumAttachedMessages;
    int i;
    for (i = 0; i < n; i++)
        {
        attachedEmail = email.GetAttachedMessage(i);

        // Get the filename for this attached message
        // (This may or may not be present, or you may decide not to use
        // the embedded filename anyway...)
        filename = email.GetAttachedMessageFilename(i);
        if (filename.Length == 0)
            {
            fnameIdx = fnameIdx + 1;
            filename = "email_" + Convert.ToString(fnameIdx) + ".eml";
            }

        // Save to a .eml file.
        attachedEmail.SaveEml(filename);

        // NOTE 1: Each attached message may itself contain other attached messages...
        // NOTE 2: File attachments within an attached message are not included in the
        //         attachments for the outer email.
        }
    
    }

Important: The download for this example does not contain the ChilkatDotNet.dll which
must be downloaded and installed separately at http://www.chilkatsoft.com/downloads.asp.
Once installed, add a reference to the DLL in the project by following the instructions at
http://www.example-code.com/vbdotnet/step2.asp

 

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

Email Component · XML Parser