|
| |
|
|
chobo321321
Posts: 66 Joined: 6/5/2004 Status: offline
|
ASP cdo email attachment - 11/13/2004 3:28:57
Hi, I'm trying to create a form where people can upload small files in an email attachment. For the form I just have 2 textboxes, 1 file browse component, and a submit button. Here's the asp script I'm using. I added the response write statements to see if it grabs the field content which is does, but the file attachment path doesn't inlcude the drive letter in the name. When I run the script I get the following error which points to the "objCDOSYSMail.AddAttachment strAttachment" line. CDO.Message.1 error '800c000d'
<%@LANGUAGE="VBSCRIPT">
<%
'Dimension variables
Dim objCDOSYSCon
Dim strEmail, strWebsite, strAttachment
strEmail = Request.Form("email")
strWebsite = Request.Form("website")
strAttachment = Request.Form("attachment")
Response.Write "From: " & strEmail & "<br />"
Response.Write "From: " & strWebsite & "<br />"
Response.Write "From: " & strAttachment & "<br />"
'Create the e-mail server object
Set objCDOSYSMail = Server.CreateObject("CDO.Message")
Set objCDOSYSCon = Server.CreateObject ("CDO.Configuration")
'Out going SMTP server
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.easy-answers.com"
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objCDOSYSCon.Fields("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
objCDOSYSCon.Fields.Update
'Update the CDOSYS Configuration
Set objCDOSYSMail.Configuration = objCDOSYSCon
objCDOSYSMail.From = strEmail
objCDOSYSMail.To = "chobo321321@work.com"
objCDOSYSMail.Subject = "Application Help"
objCDOSYSMail.TextBody = strWebsite
objCDOSYSMail.AddAttachment strAttachment
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>
|
|
|
|
chobo321321
Posts: 66 Joined: 6/5/2004 Status: offline
|
RE: ASP cdo email attachment - 11/13/2004 16:41:27
I added the line, and I get the following error message: From: chobo@hotmail.com From: www.test.com From: testing.htm CDO.Message.1 error '80070002' The system cannot find the file specified. /exp/apply.asp, line 32 I think it is checking for the file on the server, and not my machine. I also have a problem with the following line on the form enctype="multipart/form-data". When I put this line in the form the response.write statements will be blank. Once I take it out it displays whats in those fields.
|
|
|
|
chobo321321
Posts: 66 Joined: 6/5/2004 Status: offline
|
RE: ASP cdo email attachment - 11/13/2004 17:04:39
The form I'm trying to make enables users to browse their computer for a file(graphic one), and send it via email attachment. I'm kinda lost as to how I should go about this.
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|