Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ Delphi FoxPro Java Perl Python Ruby SQL Server VBScript
|
Code to Download an Email AttachmentASP code to return an email attachment.
<% ' 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.