Forum Moderators: open
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'
View Code
<%@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@example.com"
objCDOSYSMail.Subject = "Application Help"
objCDOSYSMail.TextBody = strWebsite
objCDOSYSMail.AddAttachment strAttachment
objCDOSYSMail.Send
'Close the server mail object
Set objCDOSYSMail = Nothing
Set objCDOSYSCon = Nothing
%>
[edited by: Xoc at 6:42 pm (utc) on Nov. 15, 2004]
[edit reason] changed to use example.com [/edit]