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

Send HTML Email

Download Chilkat Email ActiveX

This Visual FoxPro example creates a multipart/alternative email containing both HTML and plain-text bodies and sends it.

***********************************************************
*** Chilkat SMTP: Send a HTML email without attachments
***********************************************************

LOCAL loMailMan, loEmail, lnSuccess


********************************************************************
*!*	object loMailman (ChilkatMailMan) manages pop3 / smtp configuration
*!*	and sending and receiving email
********************************************************************
*!*	object loEMail (ChilkatEmail) represents an email
********************************************************************


****************************
*!*	configure smtp options
****************************
loMailman = CreateObject('Chilkat.MailMan2')
loMailman.UnlockComponent('mailUnlockCode')        && Unlocks the mailman object

*The hostname of the SMTP server used to send email
loMailman.SmtpHost     = 'smtp.earthlink.net'

****************************
*!*	create the email
****************************
loEmail         = CreateObject("Chilkat.Email2")
loEmail.AddTo   ( "Chilkat Support", "support@chilkatsoft.com")           && Adds a recipient to the "to" list
loEmail.Subject = "Hello! This is a test email"           && The subject of the email
loEmail.Body    = "This is the plain-text alternative"                      && The plain-text body of the email
loEmail.AddHtmlAlternativeBody("<html><body><b>This is bold-faced text</b></body></html>")
loEmail.FromName    = 'Matt'
loEmail.FromAddress = "matt@chilkatsoft.com" 

*Send an email. If mail was not successfully sent to any recipients, then an error is raised
lnSuccess = loMailman.SendEmail(loEmail) 

*!*	Nobody got the email: Function returns 0 and error is raised. 
*!*	Everybody got the email: Function returns 1. 
*!*	Some, but not everyone, got the email: Function returns 0, but error is not raised.

IF ( lnSuccess = 1 )
	=MESSAGEBOX('The mail was sent succesfully',0+64,'Chilkat send email')
ENDIF

******************************************************************************
* Releasing objects
******************************************************************************
RELEASE loMailman, loEmail

RETURN .T.
******************************************************************************

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

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