Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > ASP Forms
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old April 14th, 2004, 08:39 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default (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 = "prashanti@webraiser.com " 'the destination
    objMail.From = "prashanti@webraiser.com" '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

  #2 (permalink)  
Old April 15th, 2004, 03:15 AM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

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)

  #3 (permalink)  
Old April 15th, 2004, 03:01 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)

  #4 (permalink)  
Old April 15th, 2004, 03:37 PM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

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)

  #5 (permalink)  
Old April 19th, 2004, 03:27 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)

  #6 (permalink)  
Old April 19th, 2004, 03:56 PM
Imar's Avatar
Wrox Author
Points: 67,581, Level: 100
Points: 67,581, Level: 100 Points: 67,581, Level: 100 Points: 67,581, Level: 100
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 16,269
Thanks: 66
Thanked 1,428 Times in 1,408 Posts
Default

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)

  #7 (permalink)  
Old April 20th, 2004, 07:13 PM
Registered User
 
Join Date: Apr 2004
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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)

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error Type: (0x80004005) Unspecified error wilfree Classic ASP Databases 3 April 3rd, 2007 10:04 AM
Unspecified error mahesh_82 ADO.NET 1 January 10th, 2007 06:24 AM
Unspecified Error??? werD420 Classic ASP Databases 2 April 10th, 2005 02:00 PM
unspecified error Meterman Classic ASP Databases 1 July 13th, 2004 11:19 AM
(0x80004005) Unspecified error MiltonAbreu Classic ASP Components 6 July 7th, 2004 12:34 PM



All times are GMT -4. The time now is 12:17 PM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.