FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
POP3
RSA
S/MIME
Socket
Spider
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
String
Tar
Upload
XML
XMP
Zip Compression
Self-Extractor

More Examples...
Email Object
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

Delete POP3 Email in Visual FoxPro

Download Chilkat Email ActiveX

This Visual FoxPro source code example shows how to delete POP3 mail.

***********************************************************
*** Visual FoxPro to Delete 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, save each as XML, 
* display each, and delete from the POP3 server.
* We could have removed all the emails from the
* POP3 server by calling Transfer mail, but this demonstrates
* how to selectively delete an email after it has
* been downloaded.
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)
	
	* If the email has no attachments, delete it from the POP3 server.
	IF loEmail.NumAttachments = 0 then
		* Our local object is still useable, but the email has been removed from the server.
		=loMailman.DeleteEmail(loEmail)
	ENDIF
	
	RELEASE loEmail
	
NEXT


RELEASE loMailman, loBundle

RETURN .T.
******************************************************************************

Need a specific example? Send a request to support@chilkatsoft.com

© 2000-2010 Chilkat Software, Inc. All Rights Reserved.

Mail Component · .NET Email Component · ASP Mail Component · XML Parser