FoxPro Examples

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

Visual FoxPro Examples

Bounced Mail
Bz2
Character Encoding
CSV
Digital Certificates
Digital Signatures
Email
Email Object
FTP
HTML Conversion
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...
Amazon S3
DKIM / DomainKey
NTLM
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA
FileAccess
Bzip2
LZW

 

Non-Chilkat Links
Text and String Handling

SSL POP3 with Certificates

Demonstrates how to use a client-side certificate with an SSL connection to a POP3 server. Also demonstrates how to get the POP3 server's SSL certificate.

Download Chilkat Email ActiveX

LOCAL loMailman
LOCAL lnSuccess
LOCAL loClientCert
LOCAL loServerCert

*  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
    =MESSAGEBOX("Component unlock failed")
    QUIT
ENDIF

*  Set the GMail account POP3 properties.
loMailman.MailHost = "pop.gmail.com"
loMailman.PopUsername = "chilkat.support"
loMailman.PopPassword = "****"
loMailman.PopSsl = 1
loMailman.MailPort = 995

*  Use our certificate, which is already installed
*  in our current-user certificate store on the computer.
loClientCert = CreateObject('Chilkat.Cert')
lnSuccess = loClientCert.LoadByCommonName("Chilkat Software, Inc.")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loClientCert.LastErrorText)
    QUIT
ENDIF

*  Note: The GMail POP3 server does not require that you
*  have a client cert.  This example only demonstrates
*  how you may use a client certificate.  Typically,
*  higher-security systems may require a client-side SSL cert.
loMailman.SetSslClientCert(loClientCert)

*  Establish a POP3 connection:
lnSuccess = loMailman.Pop3BeginSession()
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMailman.LastErrorText)
    QUIT
ENDIF

*  Let's look at the LastErrorText to see the details
*  of the successful connection.  We should see our cert:
? loMailman.LastErrorText

*  OK, now examine the server's cert:

loServerCert = loMailman.GetPop3SslServerCert()
IF (loServerCert = NULL ) THEN
    =MESSAGEBOX("No server cert available.")
ELSE
    ? "Server SSL certificate:"
    ? loServerCert.SubjectDN

    *  Was the server certificate verified?
    *  It's not necessarily an error if the SSL Server cert is not verified.
    IF (loMailman.Pop3SslServerCertVerified = 1) THEN
        ? "Server SSL certificate was verified."
    ELSE
        ? "Server SSL certificate was NOT verified!"
    ENDIF

ENDIF


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

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