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

Verify Email Addresses with VerifyRecipients

Download Chilkat Email ActiveX

Verify email recipients. This example demonstrates the usage of the VerifyRecipients method.

Please see this blog post for more information VerifyRecipients -- Validating Email Addresses

LOCAL loMailman
LOCAL lnSuccess
LOCAL loEmail
LOCAL loSaBadAddrs
LOCAL i
LOCAL n

*  The mailman object is used for sending and receiving 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 SMTP server.
*  This code was tested against both mail.chilkatsoft.com
*  and smtp.comcast.net

*  mailman.SmtpHost = "mail.chilkatsoft.com";
*  mailman.SmtpUsername = "admin@chilkatsoft.com";
*  mailman.SmtpPassword = "****";

loMailman.SmtpHost = "smtp.comcast.net"

*  Create an email object.
*  We'll never actually send this email.  It's only used
*  to test the recipients.
loEmail = CreateObject('Chilkat.Email2')

loEmail.Subject = "This is a test"
loEmail.Body = "This is a test"
loEmail.From = "Chilkat Support <support@chilkatsoft.com>"

*  Add recipients to be checked.
*  (When this was tested, a_real_person was replaced with
*  a valid email address.)
loEmail.AddTo("A Real Person","a_real_person@comcast.net")
loEmail.AddTo("Testing","doesNotExist7434@comcast.net")
loEmail.AddTo("Admin","admin@chilkatsoft.com")
loEmail.AddTo("Not Exist","doesNotExist@chilkatsoft.com")
loEmail.AddCC("Not Exist","DoesNotExist7213@gmail.com")
loEmail.AddBcc("Exists","chilkat.support@gmail.com")

*  NOTE: A mail server can only verify the email addresses
*  specific to it's domain.  Therefore, when using smtp.comcast.net,
*  only comcast.net email addresses will be flagged as invalid,
*  and when using mail.chilkatsoft.com, only chilkatsoft.com
*  email addresses are flagged as invalid.

*  Return all bad email addresses in saBadAddrs:

loSaBadAddrs = loMailman.VerifyRecipients(loEmail)
IF (loSaBadAddrs = NULL ) THEN
    =MESSAGEBOX(loMailman.LastErrorText)

ELSE
    *  List the invalid email addresses:
    IF (loSaBadAddrs.Count > 0) THEN

        n = loSaBadAddrs.Count
        FOR i = 0 TO n - 1
            ? loSaBadAddrs.GetString(i)
        NEXT

        *  Examine the SMTP session log to see how the email
        *  addresses were caught:
        =MESSAGEBOX(loMailman.SmtpSessionLog)

        RELEASE loSaBadAddrs
    ENDIF
ENDIF

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

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