 |
| ASP Forms As of Oct 5, 2005, this forum is now locked. Please use "Classic ASP beginner" at http://p2p.wrox.com/forum.asp?FORUM_ID=54 or "Classic ASP Professional" http://p2p.wrox.com/forum.asp?FORUM_ID=56 instead. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the ASP Forms section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

April 14th, 2004, 07:39 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
(0x80004005) Unspecified error
Hi
I am trying to send an email through my ASP code. It works fine when I attach the document from .. say the C: drive. When i try to sttach a document from the desktop, it throws this error.
This is the form
<form id=form1 name=formEmail action="emailExcel.asp" method="get">
<P>
<b>Attachment:<input type=file name="attachment">
</p>
<input type=submit value="EMAIL" name=submit>
<form>
This is emailExcel.asp
<%
'Emailing the excel
Dim objMail
Set objMail = Server.CreateObject("CDONTS.NewMail")
objMail.To = " [email protected] " 'the destination
objMail.From = " [email protected]" 'the sender
Dim txtBody
txtBody = "VendiPIN requests from WebRaiser Technologies"
objMail.Subject = "VendiPIN requests from WebRaiser Technologies" 'the subject
objMail.Body = txtBody 'the body
objMail.Importance = 2
'THIS IS THE LINE THAT GIVES ME THE ERROR
objMail.AttachFile request("attachment"),request("filename") 'attach file
objMail.Send 'fire off the email
Set fs=Server.CreateObject("Scripting.FileSystemObject ")
fs.DeleteFile (request("attachment"))
Response.write("attachment :"& request("attachment"))
'Response.write("fileName :"& request("filename"))
%>
Any help would be appreciated.Thanks in advance
|
|

April 15th, 2004, 02:15 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
You can't attach a file from the desktop directly like that. The e-mail is sent from the server, while the attachment resides at the client (the Desktop), even if both are on the same physical machine.
To send the attachment, you'll have to upload the file to the server first. There you'll have to save it to the local disk and then attach it to your message.
To upload the file to the server, you need a (third-party) upload component. Microsoft has one (the Posting Acceptor) but I do not recommend it. One control that has proven to be useful to me, is the Dundas upload control which you can find here: http://aspalliance.com/dundas/default.aspx It comes with good documentation, so you should be able to figure out what to do.
To get you started, these are the steps you need to perform:
1. Install Dundas
2. Have your page submit to the server
3. Use the Dundas control to extract the uploaded files and other form fields
4. Save the file to disk at the server
5. Build your e-mail, set fields from the form etc
6. Attach the physical file from the disk at the server
7. Send the e-mail
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: This Is The Day by The The (Track 2 from the album: Soul Mining)
|
|

April 15th, 2004, 02:01 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey Thanks .. I'll try that out. But I wonder why it allows me to mail from the C: drive and not from the desktop. I wonder if it could also be because the path is too long.
Quote:
quote:Originally posted by Imar
Hi there,
You can't attach a file from the desktop directly like that. The e-mail is sent from the server, while the attachment resides at the client (the Desktop), even if both are on the same physical machine.
To send the attachment, you'll have to upload the file to the server first. There you'll have to save it to the local disk and then attach it to your message.
To upload the file to the server, you need a (third-party) upload component. Microsoft has one (the Posting Acceptor) but I do not recommend it. One control that has proven to be useful to me, is the Dundas upload control which you can find here: http://aspalliance.com/dundas/default.aspx It comes with good documentation, so you should be able to figure out what to do.
To get you started, these are the steps you need to perform:
1. Install Dundas
2. Have your page submit to the server
3. Use the Dundas control to extract the uploaded files and other form fields
4. Save the file to disk at the server
5. Build your e-mail, set fields from the form etc
6. Attach the physical file from the disk at the server
7. Send the e-mail
HtH,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: This Is The Day by The The (Track 2 from the album: Soul Mining)
|
|
|

April 15th, 2004, 02:37 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
How did you attach the file in both cases?
Did you attach the file directly, or from browsing with the :<input type="file">?
If you attached them, maybe it's a permissions issue.
If you elaborate a bit how you attached the files, I might be able to tell for sure....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Badger by The Tea Party (Track 4 from the album: The Edges Of Twilight)
|
|

April 19th, 2004, 02:27 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hey ..
Yeah I attached it using the <input type="file".. statement.
But I did it the way you suggested, and it would work fine except that I get the "Error 70: Permission denied" error.
Thanks for all your help :D
Quote:
quote:Originally posted by Imar
How did you attach the file in both cases?
Did you attach the file directly, or from browsing with the :<input type="file">?
If you attached them, maybe it's a permissions issue.
If you elaborate a bit how you attached the files, I might be able to tell for sure....
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: The Badger by The Tea Party (Track 4 from the album: The Edges Of Twilight)
|
|
|

April 19th, 2004, 02:56 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
You have to make sure that the IUSR_Account has enough permissions to write to the folder where you are saving your images.
If you use a control that supports "Save to Memory", this might be a temp folder; otherwise it's the folder where you ave your image.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Lonely World by Limp Bizkit (Track 11 from the album: Results May Vary)
|
|

April 20th, 2004, 06:13 PM
|
|
Registered User
|
|
Join Date: Apr 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Yup, that's what it was. Thanks a ton
Quote:
quote:Originally posted by Imar
You have to make sure that the IUSR_Account has enough permissions to write to the folder where you are saving your images.
If you use a control that supports "Save to Memory", this might be a temp folder; otherwise it's the folder where you ave your image.
Cheers,
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
While typing this post, I was listening to: Lonely World by Limp Bizkit (Track 11 from the album: Results May Vary)
|
|
|
 |