Discussion Locked

Automating email attachments with ASP

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
I am trying to make an easy download facility for training files. Users are familiar with email attachments so this is the route I am taking. I can attach a single file to an email but am having trouble adding multiple attachments. I am using VBScript for the ASP. Any suggestions ?

3 replies

by bedri c. kurdoglu

I strongly suggest you to download the aspmail. It is free and it makes tasks more easier. http://www.aspemail.com/download.html

Here is the code how you can attach multiple files to an e-mail. You should add another line for each attachment.
---------------------CODE-------------------
<%
' change to address of your own SMTP server
strHost = "mail.atlantech.net"

If Request("Send") <> "" Then

Set Mail = Server.CreateObject("Persits.MailSender")
' enter valid SMTP host
Mail.Host = strHost

Mail.From = "info@persits.com"
Mail.FromName = "Persits Software, Inc."
Mail.AddAddress Request("To")

' Attach two files in the same directory (any file type can be attached)
strPath = Server.MapPath(".") Mail.AddAttachment strPath & "\ps_logo.gif"
Mail.AddAttachment strPath & "\wehave.gif"

' message subject
Mail.Subject = "Logo & Motto"
' message body
Mail.Body = "Persits Software logo and motto images are attached."

Mail.Send ' send message

Response.Write "Success!

"
End If
%>

AspEmail: Attachments.asp

AspEmail: Attachments.asp

by p.jackson

Bedri,
Many thanks for your response. I have now fixed my problem and have a neat automatic email with multiple attachments.
Enjoy your TechPoints!!

Paul

This discussion is closed to new replies.