Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Read emails in vfp9
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01451712
Message ID:
01451873
Views:
58
Hi Yuri
the one i found required referencing a specific software application (chilkat) so the code didn't take me very far - i was wondering if something was packaged with VFP - Chilkay also looked like it was taking me to place i didn't particularly want to go. At any rate here is a copy of it.

thanks for your reply Yuri
k
***********************************************************
*** 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.
******************************************************************************
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform