Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Read Email in Visual FoxPro
This Visual FoxPro source code example shows how to read POP3 email. ***********************************************************
*** Visual FoxPro to Read Mail from a POP3 Server
***********************************************************
LOCAL loMailMan, loEmail, loBundle, lnSuccess, lcSummary
****************************
*!* configure POP3 options
****************************
loMailman = CreateObject('Chilkat.MailMan2')
loMailman.UnlockComponent('unlock_code')
loMailman.MailHost = 'mail.chilkatsoft.com'
loMailman.PopUsername = 'matt'
loMailman.PopPassword = 'myPassword'
* Read Email from the POP3 Server
* CopyMail copies it from the POP3 server (leaving it there)
* while TransferMail moves it off the POP3 server.
loBundle = loMailman.CopyMail()
* Loop over the emails in the bundle and save each as XML.
FOR i = 0 TO loBundle.MessageCount-1
loEmail = loBundle.GetEmail(i)
=loEmail.SaveXml("email" + LTRIM(STR(i)) + ".xml")
lcSummary = "From: " + loEmail.From + CHR(13)+CHR(10)
lcSummary = lcSummary + "Subject: " + loEmail.Subject + CHR(13)+CHR(10)
lcSummary = lcSummary + "Date: " + DTOS(loEmail.LocalDate) + CHR(13)+CHR(10)
lcSummary = lcSummary + "Attachments: " + STR(loEmail.NumAttachments) + CHR(13)+CHR(10)
lcSummary = lcSummary + "Body: " + loEmail.Body
=MESSAGEBOX(lcSummary)
RELEASE loEmail
NEXT
RELEASE loMailman, loBundle
RETURN .T.
******************************************************************************
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2007 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser