Welcome to WebmasterWorld Guest from 220.127.116.11
Forum Moderators: ocean10000
CDO.Message.1 error '80070003'
The system cannot find the path specified.
Now I know that the file exists and that the path specified is correct. Checked 100 times. I've hardcoded the file path in the AddAttachment. Any help on what could be going on would be great. Thank You. Here is my code:
<!--METADATA TYPE="typelib" UUID="CD000000-8B95-11D1-82DB-00C04FB1625D" NAME="CDO for Windows Library" -->
<!--METADATA TYPE="typelib" UUID="00000205-0000-0010-8000-00AA006D2EA4" NAME="ADODB Type Library" -->
Dim objConfig ' As CDO.Configuration
Dim objMessage ' As CDO.Message
Dim Fields ' As ADODB.Fields
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "#*$!#*$!xxxxx"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
' thisEmail = "firstname.lastname@example.org"
thisEmail = "email@example.com"
bodyContent = "<html>xxxxxxxxxxxx</html>"
.To = thisEmail
.From = "firstname.lastname@example.org"
.Subject = "xxxxxxxxxx"
.HTMLBody = bodyContent
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
The attachment does work, but only when I'm attaching a file from the server. I'm having people fill out a form and then want them to attach a file from their local hard drive.
Ohhhh.... That's completely different!
The ASP code you've written is running on the *web server*, not the user's machine. So of course there's no file in the path the user is specifying.
You'll probably need to upload the user's file to a temporary location on the web server, then attach that temporary file to the e-mail, then delete the file from the temporary location. There might be a more direct way to do it - I haven't tried.
First order of business is to find code for uploading a file from the user's machine - shouldn't be hard to find. You'll need to make sure you have the proper permissions set on the destination directory on the server - which may take a call to your hosting provider.
After that it should be fairly straightforward.