Classic ASP
Classic ASP
Send a POP3 RSET to Unmark Deletions
See more POP3 Examples
Demonstrates the Chilkat MailMan.Pop3Reset method, which sends the POP3 RSET command to the server. Any messages marked for deletion during the current session are unmarked and remain in the mailbox, and the POP3 session stays open. This example marks a message for deletion, then clears the mark with RSET.
Background:
RSET is POP3's in-session undo for deletion marks. It differs from Pop3EndSessionNoQuit, which also discards pending deletions but closes the connection. With RSET the authenticated session continues, so you can clear the marks and keep working — handy when a processing step fails partway and you want to retry without reconnecting.Chilkat Classic ASP Downloads
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
success = 0
' Demonstrates the MailMan.Pop3Reset method, which sends the POP3 RSET command. Any
' messages marked for deletion during the current session are unmarked and remain in the
' mailbox. The POP3 session stays open.
set mailman = Server.CreateObject("Chilkat.MailMan")
' Configure the POP3 server connection.
mailman.MailHost = "pop.example.com"
mailman.MailPort = 995
mailman.PopSsl = 1
mailman.PopUsername = "user@example.com"
mailman.PopPassword = "myPassword"
success = mailman.Pop3BeginSession()
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
' Mark a message for deletion...
success = mailman.DeleteByMsgnum(1)
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
' ...then change your mind: RSET unmarks all pending deletions but keeps the session open.
success = mailman.Pop3Reset()
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
' Ending the session now commits nothing, because the marks were cleared.
success = mailman.Pop3EndSession()
If (success = 0) Then
Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
Response.End
End If
Response.Write "<pre>" & Server.HTMLEncode( "Pending deletions were unmarked with RSET.") & "</pre>"
%>
</body>
</html>