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 Signed (S/MIME) Email

Demonstrates how to download and verify digitally signed S/MIME email.

Download Chilkat Email ActiveX

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
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

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

'  Set the POP3 login/password.
mailman.PopUsername = "myLogin"
mailman.PopPassword = "myPassword"

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

End If

n = sa.Count

For i = 0 To n - 1

    uidl = sa.GetString(i)

    ' email is a Chilkat.Email2
    Set email = mailman.FetchEmail(uidl)
    If (email Is Nothing ) Then
        Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"
        Exit Do
    End If

    Response.Write "<pre>" & Server.HTMLEncode( email.From) & "</pre>"
    Response.Write "<pre>" & Server.HTMLEncode( email.Subject) & "</pre>"

    '  The security layers of signed and/or encrypted emails
    '  are automatically "unwrapped" when loaded into
    '  a Chilkat email object.
    '  An application only needs to check to see if an email
    '  was received signed or encrypted, and then examine
    '  the success/failure.  For example:
    If (email.ReceivedSigned = 1) Then

        Response.Write "<pre>" & Server.HTMLEncode( "This email was signed.") & "</pre>"

        '  Check to see if the signatures were verified.
        If (email.SignaturesValid = 1) Then
            Response.Write "<pre>" & Server.HTMLEncode( "Digital signature(s) verified.") & "</pre>"

            Response.Write "<pre>" & Server.HTMLEncode( "Signer: " _
                 & email.SignedBy) & "</pre>"

            '  The certificate used for signing may be obtained
            '  by calling email.GetSignedByCert.

            ' cert is a Chilkat.Cert
            Set cert = email.GetSignedByCert()
            If (cert Is Nothing ) Then
                Response.Write "<pre>" & Server.HTMLEncode( "Failed to get signing certificate object.") & "</pre>"
            Else
                Response.Write "<pre>" & Server.HTMLEncode( "Signing cert: " _
                     & cert.SubjectCN) & "</pre>"

            End If

        Else
            Response.Write "<pre>" & Server.HTMLEncode( "Digital signature verification failed.") & "</pre>"
        End If

    End If

Next

mailman.Pop3EndSession 
%>
</body>
</html>

 

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