|

DOWNLOAD
Reference
ASP Examples
WebMail ASP Example
How
to Delete an Email from the POP3 Server Mailbox
This example uses a
Filter to read messages from a mailbox, and deletes all matching
messages.
<%@ LANGUAGE="VBSCRIPT" %>
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" content="text/html; charset=iso-8859-1">
<TITLE>Chilkat WebMail - Delete Emails</TITLE>
</HEAD>
<BODY>
<%
' Create a mailman
set mailman = Server.CreateObject("ChilkatWebMail.WebMailMan")
' Unlock the component - use your trial or purchased unlock code.
mailman.UnlockComponent "unlock_code"
' Tell the mailman where to get mail, and the login/password
mailman.MailHost = "mail.chilkatsoft.com"
mailman.PopUsername = "username"
mailman.PopPassword = "password"
' Only fetch messages matching this filter.
mailman.Filter = "subject contains ""Herbal Viagra"""
' Copy the mail without removing it from the server.
' If TransferMail is called instead of CopyMail, the messages returned
' in the mailBundle are automatically removed from the POP3 server,
' and DeleteEmail does not have to be called. This example simply
' demonstrates how to call DeleteEmail.
Set mailBundle = mailman.CopyMail
For i = 0 To mailBundle.messageCount - 1
Set email = mailBundle.GetEmail(i)
Response.write "<br>" & i & "<br>"
Response.write "<b>UIDL:</b> " & Server.HTMLEncode(email.Uidl) & "<br>"
Response.write "<b>From:</b> " & Server.HTMLEncode(email.From) & "<br>"
Response.write "<b>Subject:</b> " & Server.HTMLEncode(email.Subject) & "<br>"
' Remove the email from the server.
mailman.DeleteEmail email
Response.write "<br><b>DELETED</b>
Set email = Nothing
Next
Set mailBundle = Nothing
' Standard ASP cleanup of objects
Set mailman = Nothing
%>
<BR>DONE.<BR>
</BODY>
</HTML>
|
* This example showed how to delete mail from a POP3 server in
an ASP script.
|
Privacy
Statement. Copyright 2000-2010 Chilkat
Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com Components for Microsoft Windows 7, Vista, XP, 2000, 2003 Server, and Windows 95/98/NT4.
|
|