FoxPro Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++CMFCDelphiFoxProJavaPerlPHPPythonRubySQL ServerVBScript

Visual FoxPro Examples

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

More Examples...
Email Object
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

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

LOCAL loMailman
LOCAL lnSuccess
LOCAL loDkim
LOCAL loSaUidls
LOCAL i
LOCAL loMimeBytes
LOCAL k
LOCAL lnBVerified
LOCAL lnNumDkimSigs
LOCAL lnNumDomainKeySigs

*  The mailman object is used for receiving (POP3)
*  and sending (SMTP) email.
loMailman = CreateObject('Chilkat.MailMan2')

*  Any string argument automatically begins the 30-day trial.

lnSuccess = loMailman.UnlockComponent("30-day trial")
IF (lnSuccess <> 1) THEN
    ? loMailman.LastErrorText
    QUIT
ENDIF

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

lnSuccess = loDkim.UnlockComponent("30-day trial")
IF (lnSuccess <> 1) THEN
    ? loDkim.LastErrorText
    QUIT
ENDIF

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

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

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

loSaUidls = loMailman.GetUidls()
IF (loSaUidls = NULL ) THEN
    =MESSAGEBOX(loMailman.LastErrorText)
    QUIT
ENDIF

*  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 loSaUidls.Count - 1
    loMimeBytes = loMailman.FetchMime(loSaUidls.GetString(i))

    *  Verify each DKIM signature, if any exist.
    lnNumDkimSigs = loDkim.NumDkimSignatures(loMimeBytes)
    FOR k = 0 TO lnNumDkimSigs - 1
        lnBVerified = loDkim.VerifyDkimSignature(k,loMimeBytes)
        IF (lnBVerified = 1) THEN
            ? "DKIM signature " + STR(k) + " verified"
        ELSE
            ? "DKIM signature " + STR(k) + " invalid"
            ? loDkim.LastErrorText
        ENDIF

    NEXT

    *  Verify each DomainKey signature if any exist.
    lnNumDomainKeySigs = loDkim.NumDomainKeySignatures(loMimeBytes)
    FOR k = 0 TO lnNumDomainKeySigs - 1
        lnBVerified = loDkim.VerifyDomainKeySignature(k,loMimeBytes)
        IF (lnBVerified = 1) THEN
            ? "DomainKey signature " + STR(k) + " verified"
        ELSE
            ? "DomainKey signature " + STR(k) + " invalid"
            ? loDkim.LastErrorText
        ENDIF

    NEXT
NEXT

RELEASE loSaUidls

Need a specific example? Send a request to support@chilkatsoft.com

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

Mail Component · .NET Email Component · ASP Mail Component · XML Parser