I made this form with a very basic code
<HTML>
<HEAD>
<TITLE>Submit Papers</TITLE>
</HEAD>
<BODY>
<%
If Len(Request.For m("txtEmail") ) > 0 then
Dim objMail
Set objMail = Server.CreateOb ject("CDONTS.Ne wMail")
objMail.From = Request.Form("t xtEmail")
objMail.Subject = "Email attachment demo"
objMail.AttachF ile Server.MapPath( Request.Form("a ttachment"))
objMail.To = "mymail@school. edu"
objMail.Body = "the following papers have been submitted."
objMail.Send
Response.write( "<i>EMail was Sent</i><p>")
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<b>Enter your email address:</b><br>
<input type="text" name="txtEmail"
value="<%=Reque st.Form("txtEma il")%>">
<input type=file name="attachmen t" runat=server
value="<%Reques t.Form("attachm ent")%>">
<p>
<input type="submit" value="Submit!" id=submit1 name=submit1>
</form>
</BODY>
</HTML>
---
i tried it and got this error:
Server.MapPath( ) error 'ASP 0172 : 80004005'
Invalid Path
/web/test/email/demo2.asp, line 14
The Path parameter for the MapPath method must be a virtual path. A
physical path was used.
---
is there something i should change to make sure i get what they
selected as an atachment.
thanks again,
gabriel
<HTML>
<HEAD>
<TITLE>Submit Papers</TITLE>
</HEAD>
<BODY>
<%
If Len(Request.For m("txtEmail") ) > 0 then
Dim objMail
Set objMail = Server.CreateOb ject("CDONTS.Ne wMail")
objMail.From = Request.Form("t xtEmail")
objMail.Subject = "Email attachment demo"
objMail.AttachF ile Server.MapPath( Request.Form("a ttachment"))
objMail.To = "mymail@school. edu"
objMail.Body = "the following papers have been submitted."
objMail.Send
Response.write( "<i>EMail was Sent</i><p>")
'You should always do this with CDONTS.
set objMail = nothing
End If
%>
<form method="post" id=form1 name=form1>
<b>Enter your email address:</b><br>
<input type="text" name="txtEmail"
value="<%=Reque st.Form("txtEma il")%>">
<input type=file name="attachmen t" runat=server
value="<%Reques t.Form("attachm ent")%>">
<p>
<input type="submit" value="Submit!" id=submit1 name=submit1>
</form>
</BODY>
</HTML>
---
i tried it and got this error:
Server.MapPath( ) error 'ASP 0172 : 80004005'
Invalid Path
/web/test/email/demo2.asp, line 14
The Path parameter for the MapPath method must be a virtual path. A
physical path was used.
---
is there something i should change to make sure i get what they
selected as an atachment.
thanks again,
gabriel
Comment