Chilkat HOME Android™ ASP Visual Basic VB.NET C# iOS (IPhone) Objective-C C++ C Unicode C++ Unicode C MFC Delphi DLL Delphi ActiveX FoxPro Java Perl PHP Extension PHP ActiveX Python PowerShell Ruby SQL Server VBScript
Fetch MIME Source from POP3 ServerDownload: 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 |
© 2000-2013 Chilkat Software, Inc. All Rights Reserved.