-=j0nnyr0773n=-
02 Nov 2005, 07:22 PM
Hey all,
I have created an AspEmail form that works flawlessly. Also on the same page I have created two fields that you can browse your local pc and click upload to upload two files to a directory called /upload on the web server via ASPupload. Now I want to be able to attach those two specific files to the mail form when it is submitted to the server. My predicament is that all the documentation I have come across says you need to specifically state the exact path to the filenames to be attached eg...
Mail.AddAttachment="/upload/filename.txt"
Now that is fine, I understand that but in my situation users will be uploading resumes and headshots to the server from their own pc's and the filenames and types will be different everytime. The locations will be the same but the names and types different. Is there a way to tell the form to attach the two last uploaded files to the message? Here is a sample of my code:
<% @LANGUAGE=VBSCRIPT %>
<HTML>
<BODY>
<%
strHost = "mail.accuwebhosting.biz"
If Request("SUBMIT") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.From = Request("email")
Mail.FromName = Request("email")
Mail.AddAddress "webform@selfcenteredproductions.com"
Mail.Subject = Request("Self Centered Productions Webform Inquiry")
Mail.Body = "First Name: " & request("firstname") & vbCrlf & "Last Name: " & request("lastname") & vbCrlf & "Company Name: " & request("company") & vbCrLf & "Trade: " & request("trade") & vbCrLf & "Home Phone: " & request("telephone") & vbCrLf & "Cell Phone: " & request("cellphone") & vbCrLf & "Location Residing: " & request("location") & vbCrLf & "Comments and Messages: " & request("comments")
strErr = ""
bSuccess = False
On Error Resume Next
Mail.Send
If Err <> 0 Then
strErr = Err.Description
else
bSuccess = True
End If
End If
response.redirect "resume.htm"
%>
</BODY>
</HTML>
Thank you in advance for any insight.
-=j0nnyr0773n=- :D
I have created an AspEmail form that works flawlessly. Also on the same page I have created two fields that you can browse your local pc and click upload to upload two files to a directory called /upload on the web server via ASPupload. Now I want to be able to attach those two specific files to the mail form when it is submitted to the server. My predicament is that all the documentation I have come across says you need to specifically state the exact path to the filenames to be attached eg...
Mail.AddAttachment="/upload/filename.txt"
Now that is fine, I understand that but in my situation users will be uploading resumes and headshots to the server from their own pc's and the filenames and types will be different everytime. The locations will be the same but the names and types different. Is there a way to tell the form to attach the two last uploaded files to the message? Here is a sample of my code:
<% @LANGUAGE=VBSCRIPT %>
<HTML>
<BODY>
<%
strHost = "mail.accuwebhosting.biz"
If Request("SUBMIT") <> "" Then
Set Mail = Server.CreateObject("Persits.MailSender")
Mail.Host = strHost
Mail.From = Request("email")
Mail.FromName = Request("email")
Mail.AddAddress "webform@selfcenteredproductions.com"
Mail.Subject = Request("Self Centered Productions Webform Inquiry")
Mail.Body = "First Name: " & request("firstname") & vbCrlf & "Last Name: " & request("lastname") & vbCrlf & "Company Name: " & request("company") & vbCrLf & "Trade: " & request("trade") & vbCrLf & "Home Phone: " & request("telephone") & vbCrLf & "Cell Phone: " & request("cellphone") & vbCrLf & "Location Residing: " & request("location") & vbCrLf & "Comments and Messages: " & request("comments")
strErr = ""
bSuccess = False
On Error Resume Next
Mail.Send
If Err <> 0 Then
strErr = Err.Description
else
bSuccess = True
End If
End If
response.redirect "resume.htm"
%>
</BODY>
</HTML>
Thank you in advance for any insight.
-=j0nnyr0773n=- :D