Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
|
Add File Attachments to an EmailDemonstrates how to add one or more file attachments to an email.
LOCAL loEmail LOCAL lnSuccess LOCAL lcContentType loEmail = CreateObject('Chilkat.Email2') loEmail.Subject = "This is a test" loEmail.Body = "This is a test" loEmail.From = "support@chilkatsoft.com" loEmail.AddTo("Chilkat Admin","admin@chilkatsoft.com") * To add file attachments to an email, call AddFileAttachment * once for each file to be attached. The method returns * the content-type of the attachment if successful, otherwise * returns cknull lcContentType = loEmail.AddFileAttachment("something.pdf") IF (lcContentType = NULL ) THEN ? loEmail.LastErrorText QUIT ENDIF lcContentType = loEmail.AddFileAttachment("something.xml") IF (lcContentType = NULL ) THEN ? loEmail.LastErrorText QUIT ENDIF lcContentType = loEmail.AddFileAttachment("something.zip") IF (lcContentType = NULL ) THEN ? loEmail.LastErrorText QUIT ENDIF lnSuccess = loEmail.SaveEml("email.eml") IF (lnSuccess = 0) THEN ? loEmail.LastErrorText QUIT ENDIF =MESSAGEBOX("Saved EML!") |
© 2000-2010 Chilkat Software, Inc. All Rights Reserved.
Mail Component · .NET Email Component · ASP Mail Component · XML Parser