ASP Examples

ChilkatHOMEAndroid™ASPVisual BasicVB.NETC#iOS (IPhone)Objective-CC++CMFCDelphiFoxProJavaPerl
PHP ExtensionPHP ActiveXPythonPowerShellRubySQL ServerVBScript

ASP Examples

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

More Examples...
Amazon S3
Email Object
DKIM / DomainKey
NTLM
DH Key Exchange
DSA
FileAccess
RSS
Atom
Self-Extractor
Service
PPMD
Deflate
Bzip2
LZW

 

 

 

 

 

 

POP3 Verify DKIM Signatures

Download the email from a POP3 mailbox and verify each DKIM or DomainKey signature.

Download Chilkat Email ActiveX

Download Chilkat MIME ActiveX

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
'  The mailman object is used for receiving (POP3)
'  and sending (SMTP) email.
set mailman = Server.CreateObject("Chilkat.MailMan2")

'  Any string argument automatically begins the 30-day trial.
success = mailman.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"

End If

'  We'll also be needing the Chilkat DKIM object.
'  The Chilkat DKIM functionality is included in the "Chilkat MIME" license.
set dkim = Server.CreateObject("Chilkat.Dkim")

success = dkim.UnlockComponent("30-day trial")
If (success <> 1) Then
    Response.Write "<pre>" & Server.HTMLEncode( dkim.LastErrorText) & "</pre>"

End If

'  Set the POP3 server's hostname
mailman.MailHost = "mail.cknotes.com"

'  Set the POP3 login/password.
mailman.PopUsername = "admin@cknotes.com"
mailman.PopPassword = "myPassword"

'  First, get the complete set of UIDLs for the email in the POP3 mailbox:

' saUidls is a Chilkat.CkStringArray
Set saUidls = mailman.GetUidls()
If (saUidls Is Nothing ) Then
    Response.Write "<pre>" & Server.HTMLEncode(mailman.LastErrorText) & "</pre>"

End If

'  Download each email into a byte array
'  If DKIM signature verification is to be performed,
'  it is important to download the email exactly as-is.

For i = 0 To saUidls.Count - 1
    mimeBytes = mailman.FetchMime(saUidls.GetString(i))

    '  Verify each DKIM signature, if any exist.
    numDkimSigs = dkim.NumDkimSignatures(mimeBytes)
    For k = 0 To numDkimSigs - 1
        bVerified = dkim.VerifyDkimSignature(k,mimeBytes)
        If (bVerified = 1) Then
            Response.Write "<pre>" & Server.HTMLEncode( "DKIM signature " _
                 & k & " verified") & "</pre>"
        Else
            Response.Write "<pre>" & Server.HTMLEncode( "DKIM signature " _
                 & k & " invalid") & "</pre>"
            Response.Write "<pre>" & Server.HTMLEncode( dkim.LastErrorText) & "</pre>"
        End If

    Next

    '  Verify each DomainKey signature if any exist.
    numDomainKeySigs = dkim.NumDomainKeySignatures(mimeBytes)
    For k = 0 To numDomainKeySigs - 1
        bVerified = dkim.VerifyDomainKeySignature(k,mimeBytes)
        If (bVerified = 1) Then
            Response.Write "<pre>" & Server.HTMLEncode( "DomainKey signature " _
                 & k & " verified") & "</pre>"
        Else
            Response.Write "<pre>" & Server.HTMLEncode( "DomainKey signature " _
                 & k & " invalid") & "</pre>"
            Response.Write "<pre>" & Server.HTMLEncode( dkim.LastErrorText) & "</pre>"
        End If

    Next
Next


%>
</body>
</html>

 

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