ASP Examples

ChilkatHOMEASPVisual BasicVB.NETC#Visual C++DelphiFoxProJavaPerlPythonRubySQL ServerVBScript

ASP Examples

ASP String
ASP Byte Array
Bounced Mail
Character Encoding
Digital Certificates
Digital Signatures
Email
FTP
HTML-to-XML
HTTP
IMAP
Encryption
MHT / HTML Email
S/MIME
Socket
Spider
RSA Encryption
Tar
Upload
XML
XMP
Zip Compression

More Examples...
Email Object
POP3
SMTP
RSS
Atom
Self-Extractor

Unreleased...
Service
PPMD
Deflate
Bzip2
LZW
Bz2
DH Key Exchange
DSA
Icon

 

 

 

 

 

 

Code to Download an Email Attachment

ASP code to return an email attachment.

Download Chilkat Email ActiveX for POP3 / SMTP

Download Chilkat IMAP ActiveX

<%

'  This ASP will return an email's Nth attachment.

'  The 1st attachment is at index 0.
attachIdx = 0
'  This is the filename of the .eml on the ASP server.
emlFilename = "testEmail.eml"

'  An email can be loaded into an email object from memory
'  by calling SetFromMimeText, or from a file by calling
'  LoadEml.

'  Create a MailMan object first for the purpose
'  of unlocking the component. (Only one is necessary)
set mailman = Server.CreateObject("Chilkat.MailMan2")
mailman.UnlockComponent "anything for 30-day trial"

set email = Server.CreateObject("Chilkat.Email2")

'  Load an email containing attachments.

'  
success = email.LoadEml(Server.MapPath(emlFilename))
If (success <> 1) Then
    Response.Write email.LastErrorText & "<br>"

End If

'  
Response.ContentType = email.GetAttachmentContentType(attachIdx)

Response.BinaryWrite email.GetAttachmentData(attachIdx)


%>
 

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

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