Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicPythonRubySQL ServerSwiftTclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcel

Classic ASP Examples


ASN.1
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Bounced Email
Box
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
ECC
Email Object
Encryption
FTP
Facebook
Firebase
GeoOp
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
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
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
PayPal
Peoplevox
QuickBooks
REST
RSA Encryption
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Shopify
Socket/SSL/TLS
Spider
Stream
Stripe
SugarCRM
Tar Archive
Twitter
VoiceBase
Walmart
WebSocket
XML
XML Digital Signatures
XMP
Xero
Zip
curl
eBay

 

 

 

(Classic ASP) POP3 Verify Signed (S/MIME) Email

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

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
set mailman = Server.CreateObject("Chilkat_9_5_0.MailMan")

'  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 = "pop.someMailServer.com"

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

' sa is a Chilkat_9_5_0.StringArray
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_9_5_0.Email
    Set email = mailman.FetchEmail(uidl)
    If (email Is Nothing ) Then
        Response.Write "<pre>" & Server.HTMLEncode( mailman.LastErrorText) & "</pre>"

    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_9_5_0.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

success = mailman.Pop3EndSession()

%>
</body>
</html>

 

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