View Full Version : ASP E-mail Attachments
I have an ASP E-Mail page that allows users to send e-mail. I would like to have the capabilities of a "Browse" button on the text box that calls for Attachment File Name.
Where user can click on button and get a directory of C:\ drive etc. select file name and that would populate string value for Attachment.
Does anyone know of a script on the web I could download?
TIA
Coral_Lover
10-24-2002, 04:23 AM
Have u tried using <INPUT TYPE = "FILE"> before? This allows u to browse for files.
No! And Thank You for the tip! I will test that big tme.
Geesh! The Things You Learn from this forum!
Thank You! This one is certainly apprecated.
webmarkart
07-16-2003, 09:45 PM
Thought I'd drudge up an old post...
My company is using a form to email the developers about content additions that clients request. I'm trying to allow them to attach files now and I've run into a lot of problems.
I've attached the files and if anyone can tell me where I'm going wrong I'd appreciate it.
To see the working version...
http://www.ainspect.com/content_tom.html
webmarkart
07-17-2003, 09:35 PM
response.write "Error: " & err.number & " - " & err.description
Produces this...
7 - The filename, directory name, or volume label syntax is incorrect.
Any ideas?
arnyinc
07-17-2003, 10:41 PM
webmarkart,
I think you are attempting to do something that the software wasn't made to do. Persits Email allows you to attach files that are on the server, not the client. You would have to upload the files to the server, then attach them.
webmarkart
07-18-2003, 02:56 AM
that would explain it, it would be nice if my boss told me before I wasted my time trying (not that my boss knows what she's doing)... I'll try to use cdonts instead.
webmarkart
07-18-2003, 03:21 PM
maybe I'm getting ahead of myself... let me back up and ask a more basic question...
I customer fills out our form including browsing for attachments (from their computer). Can cdonts or Persits attach a local file from their computer. I've asked around (including arnyinc's tip) and I've been told that in order to attach a file it has to be on our server already. Is this really the case? If so there is no point in attaching it! I find it hard to believe that cdonts don't allow for local attachments from a user's computer. This is what I tried using cdonts...
<%
Option Explicit
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.From = "thomas@aprosite"
objMail.Subject = "This is an attachment"
objMail.AttachFile("C:\Documents and Settings\tm6125\My Documents\webmaster.jpg")
objMail.To = "thomas@aprosite"
objMail.Body = "This is the body of the Message"
objMail.Send
Response.write("Mail was Sent")
'You should always do this with CDONTS.
set objMail = nothing
%>
This tells me that the mail has been sent but I never get the email. And yes, cdonts are installed on our server
webmarkart
07-18-2003, 03:30 PM
Thanks, I've found the answer to my question, although it was not really the one I wanted!
NOTE: You must have the files to be attached to be present on your server (or be accessible on a remote machine by the IUSR_MachineName account) and the IUSR_MachineName must have the Read permission on the File to be attached. To allow any visitor to your page to attach a file to the mail, you'll have to first allow the client machine to upload that file to your server and then attach the file to the mail. But uploading of files can be dangerous and pose a security risk to your server as it would allow users to write files on to your server.
source: http://www.hitxp.com/comp/pro/asp/131102.htm
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.