Hello.
I'm working on an online form that allows the user to attach a dif
file. I'm having a problem with reading a file path (when "send"
button is pressed).
Error: CDO.Message.1 error '80070002'
The system cannot find the file specified.
Here is part of my code
Sub sendmail( fromWho, toWho, Subject, Body, Attachment )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPort = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail-fwd"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPconnectiontimeout) = 10
.Update
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.TextBody = Body
objCDO.AddAttachment Attachment
objCDO.Send
End Sub
'--------------- End of the sendmail Method ----------------
'-----------------------------------------------------------
Dim fromWho, toWho, Subject, Body, Attachment
'fromWho = TRIM( Request.Form("email") )
fromWho = "mm@hotmail.com"
Response.Write fromWho
toWho = "yy@yahoo.com"
Subject = "Test mail"
Body = "This is test mail"
Attachment = TRIM(Request.Form("resume"))
If toWho <> "" THEN
sendmail fromWho, toWho, Subject, Body, Attachment
'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
'Response.redirect "thankse.html"
End If
%>
The problem occurs at "objCDO.AddAttachment Attachment" part.
Does anyone have any idea how to solve the problem???
Thank you |