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

 

 

 

 

 

 

Fetch MIME Source from POP3 Server

Download: Chilkat .NET Assemblies

Download an email from a POP3 mailbox but instead of returning a Chilkat.Email object, return the email unparsed in a MIME string.

// FetchMime: Download an email from a POP3 server directly into a string without parsing.
// The typical way of retrieving email from a POP3 mailbox using the Chilkat email component is
// is to return a Chilkat.Email 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 FetchMime given a UIDL.

        private void downloadMimeSource()
        {
            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...
            Chilkat.StringArray uidlArray = mailman.GetUidls();

            // Download the MIME source of the 1st email in the list of UIDLs.
            byte [] mimeBytes = mailman.FetchMime(uidlArray.GetString(0));
            if (mimeBytes.Length == 0)
            {
                // It failed!
                MessageBox.Show(mailman.LastErrorText);
                return;
            }

            // Convert the byte array to a string.
            string mimeSource;
            System.Text.ASCIIEncoding enc = new System.Text.ASCIIEncoding();
            mimeSource = enc.GetString(mimeBytes);

            // 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();
            email.SetFromMimeText(mimeSource);

            // ...
        }


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