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

Load MIME (or S/MIME) and Send as Email

Download Chilkat MIME ActiveX

Demonstrates how to load a MIME file and send it as email.

Download Chilkat Email ActiveX

LOCAL loMime
LOCAL loMailman
LOCAL lnSuccess
LOCAL lcFromAddr
LOCAL lcRecipient
LOCAL loEmail
LOCAL lcDateStr
LOCAL lcMimeContent

loMime = CreateObject('Chilkat.Mime')
loMailman = CreateObject('Chilkat.MailMan2')

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

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

*  Any string argument automatically begins the 30-day trial.
lnSuccess = loMailman.UnlockComponent("30-day trial")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMailman.LastErrorText)
    QUIT
ENDIF

*  Set the SMTP server.
loMailman.SmtpHost = "smtp.chilkatsoft.com"

*  Set the SMTP login/password (if required)
loMailman.SmtpUsername = "myUsername"
loMailman.SmtpPassword = "myPassword"

*  Load the MIME (or S/MIME) from a file:
lnSuccess = loMime.LoadMimeFile("edifact_smime.txt")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMime.LastErrorText)
    QUIT
ENDIF

lcFromAddr = "admin@chilkatsoft.com"
lcRecipient = "support@chilkatsoft.com"

*  Add email header fields to the MIME:
loMime.AddHeaderField("From",lcFromAddr)
loMime.AddHeaderField("To",lcRecipient)
loMime.AddHeaderField("Subject","Here is my EDIFACT signed and encrypted...")

*  We want a Date header with the current date/time.  The email object
*  automatically generates it.  Therefore we'll create an email object and then
*  copy the Date header:
loEmail = CreateObject('Chilkat.Email2')

lcDateStr = loEmail.GetHeaderField("Date")
loMime.AddHeaderField("Date",lcDateStr)

*  It is not necessary to save the MIME to a file.
*  We're doing it here just to have a look at the .eml in a text editor...
lnSuccess = loMime.SaveMime("email.eml")
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMime.LastErrorText)
    QUIT
ENDIF

*  Now send the MIME via SMTP:

lcMimeContent = loMime.GetMime()
lnSuccess = loMailman.SendMime(lcFromAddr,lcRecipient,lcMimeContent)
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX(loMailman.LastErrorText)
    QUIT
ENDIF

lnSuccess = loMailman.CloseSmtpConnection()
IF (lnSuccess <> 1) THEN
    =MESSAGEBOX("Connection to SMTP server not closed cleanly.")
ENDIF

=MESSAGEBOX("Mail Sent!")

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

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