C# Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CUnicode C++Unicode CMFCDelphi DLLDelphi ActiveXFoxProJavaPerlPHP 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

 

 

 

 

 

 

Fetch Multiple MIME Sources from POP3 Server

Download: Chilkat .NET Assemblies

Download multiple emails from a POP3 mailbox but instead of returning a Chilkat.EmailBundle, return a Chilkat.StringArray object containing a collection of MIME source strings.

        // FetchMultipleMime: Download multiple emails from a POP3 server directly into a collection of strings without parsing.
        // The typical way of retrieving email from a POP3 mailbox using the Chilkat email component is
        // is to return a Chilkat.EmailBundle object.  Certain Chilkat customers with more advanced requirements
        // wish to retrieve the exact MIME source of the email without it first being parsed and
        // wrapped in a Chilkat.Email object.  This example shows how to call FetchMultipleMime given a set of UIDLs.

        private void downloadMultipleMimeSource()
        {
            Chilkat.MailMan mailman = new Chilkat.MailMan();
            mailman.UnlockComponent("Anything for 30-day trial");

            // Set our POP3 mail host and login
            mailman.MailHost = "mail.chilkatsoft.com";
            mailman.PopUsername = "****";
            mailman.PopPassword = "****";

            // For demonstration purposes, assume there is mail in the mailbox...
            // This line of code retrieves the UIDLs for all the mail in the mailbox.
            Chilkat.StringArray uidlArray = mailman.GetUidls();

            // Download the entire mailbox into a Chilkat.StringArray
            Chilkat.StringArray mimeSources = mailman.FetchMultipleMime(uidlArray);
            // FetchMultipleMime leaves the email on the server.  The TransferMultipleMime
            // method is identical, except that it also deletes the email on the server after downloading.
            if (mimeSources == null)
            {
                // It failed!
                MessageBox.Show(mailman.LastErrorText);
                return;
            }

            // Your program can do whatever it wants with the MIME.
            // One possibility is to load it into a Chilkat.Email object...
            Chilkat.Email email = new Chilkat.Email();
            int n = mimeSources.Count;
            int i;
            for (i = 0; i < n; i++)
            {
                // Load the Nth MIME source into an email object.
                email.SetFromMimeText(mimeSources.GetString(i));
                // ...
            }

        }


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-2013 Chilkat Software, Inc. All Rights Reserved.