Google Answers Logo
View Question
 
Q: CDO.message attachement ( No Answer,   2 Comments )
Question  
Subject: CDO.message attachement
Category: Computers > Programming
Asked by: lilly999-ga
List Price: $10.00
Posted: 31 Jul 2003 11:19 PDT
Expires: 30 Aug 2003 11:19 PDT
Question ID: 237435
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
Answer  
There is no answer at this time.

Comments  
Subject: Re: CDO.message attachement
From: vijayanand-ga on 03 Aug 2003 02:21 PDT
 
Attachment = TRIM(Request.Form("resume"))

the file should at the webserver directory not at the clients
disk.Upload that bfore u make it as attaxhment
Subject: Re: CDO.message attachement
From: vijayanand-ga on 10 Aug 2003 07:56 PDT
 
Before you do attachment,ask the user to attach  a file (as in yahoo)
and upload that file to your server and store that in a temporary
directory.When sending it

Attachment = TRIM(Request.Form("resume")) 

shuold be

Attachment = "the path where u have stored that file temporarily"

and send it ....

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy