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
RSS
Atom
Byte Array
Service
PPMD
Deflate
DH Key Exchange
DSA

Unreleased...
FileAccess
Bzip2
LZW
Icon

 

Non-Chilkat Links
Text and String Handling

Embed Image in HTML Email

Download Chilkat Email ActiveX

Demonstrates how to create and send an HTML email with an embedded image.

LOCAL loMailman
LOCAL lnSuccess
LOCAL loEmail
LOCAL lcFileOnDisk
LOCAL lcFilePathInHtml
LOCAL lcHtmlBody

*  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.
loMailman.SmtpHost = "smtp.comcast.net"

*  Create a new email object
loEmail = CreateObject('Chilkat.Email2')

*  Add an embedded image to the HTML email.

lcFileOnDisk = "images/dude2.gif"

lcFilePathInHtml = "something/dudeAbc.gif"

*  Embed the GIF image in the email.
lnSuccess = loEmail.AddRelatedFile2(lcFileOnDisk,lcFilePathInHtml)
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loEmail.LastErrorText)
    QUIT
ENDIF

*  The src attribute for the image tag is set to the filePathInHtml:

lcHtmlBody = [<html><body>Embedded Image:<br><img src="something/dudeAbc.gif"></body></html>]

*  Set the basic email stuff: HTML body, subject, "from", "to"
loEmail.SetHtmlBody(lcHtmlBody)
loEmail.Subject = "Visual FoxPro HTML email with an embedded image."
loEmail.AddTo("Admin","admin@chilkatsoft.com")
loEmail.From = "Chilkat Support <support@chilkatsoft.com>"

lnSuccess = loMailman.SendEmail(loEmail)
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMailman.LastErrorText)
ELSE
    =MESSAGEBOX("Mail Sent!")
ENDIF

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

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

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