Chilkat Examples

ChilkatHOMEAndroid™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi DLLGoJavaNode.jsObjective-CPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwiftTclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Classic ASP Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Cert Store
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

Download and Process Bounced Email

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

ASP example script to download email from a POP3 mailbox and process bounce (DSN) notifications and other automated email responses.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<%
	set mailman = Server.CreateObject("Chilkat_9_5_0.MailMan")

    mailman.UnlockComponent "Anything for 30-day trial"
    mailman.MailHost = "mail.chilkatsoft.com"
    mailman.PopUsername = "myLogin"
    mailman.PopPassword = "myPassword"
    
	set bounce = Server.CreateObject("Chilkat_9_5_0.Bounce")
    bounce.UnlockComponent "Anything for 30-day trial"
    
    ' Read email from the POP3 server.
    Set bundle = mailman.CopyMail()
    If (Not (bundle Is Nothing)) Then
        
        ' Loop over each email...
        For i = 0 To bundle.MessageCount - 1
            Set email = bundle.GetEmail(i)
            
            ' See if this is a bounced email.
            ' This sets the properties of the Bounce object
            bounce.ExamineMail email
            
            If (bounce.BounceType = 0) Then
                Response.Write email.Subject & "<br>"
                Response.Write "NOT A BOUNCE<br>"
                ' Not a bounce, skip it.
            ElseIf (bounce.BounceType = 1) Then
                ' Hard bounce, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Hard Bounce: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 2) Then
                ' Soft bounce, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Soft Bounce: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 3) Then
                ' General bounce, no email address available.
                Response.Write email.Subject & "<br>"
                Response.Write "General Bounce: No email address" & "<br>"
            ElseIf (bounce.BounceType = 4) Then
                ' General bounce, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "General Bounce: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 5) Then
                ' Mail blocked, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Mail Blocked: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 6) Then
                ' Auto-reply, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Auto-Reply: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 7) Then
                ' Transient (recoverable) Failure, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Transient Failure: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 8) Then
                ' Subscribe request, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Subscribe Request: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 9) Then
                ' Unsubscribe Request, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Unsubscribe Request: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 10) Then
                ' Virus Notification, log the email address
                Response.Write email.Subject & "<br>"
                Response.Write "Virus Notification: " & bounce.BounceAddress & "<br>"
            ElseIf (bounce.BounceType = 11) Then
                ' Suspected bounce.
                ' This should be rare.  It indicates that the Bounce
                ' component found strong evidence that this is a bounced
                ' email, but couldn't quite recognize everything it
                ' needed to be 100% sure.  Feel free to notify
                ' support@chilkatsoft.com regarding emails having this
                ' bounce type.
                Response.Write email.Subject & "<br>"
                Response.Write "Suspected Bounce!" & "<br>"
            End If
            
            Response.Write "<br>"
                       
            Set email = Nothing
            
        Next
    
        Set bundle = Nothing
    
    Else
        Response.Write mailman.LastErrorHtml
        
    End If
    
    Set mailman = Nothing
    

%>
</body></html>
 

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