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 > Classic ASP Professional
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP Professional For advanced coder questions in ASP 3. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Professional 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
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 15th, 2014, 03:11 PM
Authorized User
Points: 373, Level: 6
Points: 373, Level: 6 Points: 373, Level: 6 Points: 373, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default Add Attachments to Classic ASP e-mail program

Good afternoon.

Ten years ago, I created a classic asp program which sends e-mails to my users and it had been working fine. Via this program, I can also "add" attachments (which reside on my web server) to e-mails via the code below.

<input name=fleAttach1 type=file size=70 maxlength=100>

There are three problems with this approach:

1) It doesn't work with FireFox or Chrome: I receive the "fakePath" message when attempting to attach the files.

2) It doesn't work in IE, on occasion, if IE settings are incorrect.

3) I need to be on my network in order to point to files on my webserver.

I need a new approach to attaching files to my classic asp e-mail program.

What would you recommend.

Thank you for your help!

Sal
Reply With Quote
  #2 (permalink)  
Old January 15th, 2014, 03:55 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

I think you'll need to post the relevant pieces of your code, or it'll be hard to suggest a solution.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #3 (permalink)  
Old January 15th, 2014, 04:06 PM
Authorized User
Points: 373, Level: 6
Points: 373, Level: 6 Points: 373, Level: 6 Points: 373, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Sep 2004
Location: , , .
Posts: 68
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Imar,

Thank you for your response.

I use a single line of code to retrieve the file name to be "attached" to the e-mail:

<input name=fleAttach1 type=file size=70 maxlength=100>

I use a simple javaScript edit to verify the file resides on my web server.

I then submit the form and asp sends the e-mail and attachment (which works fine).

I'm looking for a totally different approach since type=file does not work with properly with Chrome or FireFox: it does not allow me to view the entire file name and determine if does reside on my webserver.

Can you recommend some sort of utility that I can plug into my asp program which will allow my users to attach and e-mail files just as in a tradition e-mail clients like gmail, etc.?

Thank you.

Sal
Reply With Quote
  #4 (permalink)  
Old January 15th, 2014, 04:22 PM
Imar's Avatar
Wrox Author
Points: 72,073, Level: 100
Points: 72,073, Level: 100 Points: 72,073, Level: 100 Points: 72,073, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

That can't have been all of it, I assume? That just works on the client and you would have no access to the path on the server where ASP runs. Or did you only use this on your own environment? If not, there must have been some code that uploads and attaches the file on the server side.

The full path is no longer exposed by the browser as that exposed too much information. However, the file, and file name are still available. If you use an external upload component (like a third party COM object or one of the available free "Pure ASP" upload scripts) you should be able to save the file using the original name, and attach it to an e-mail.

Cheers,

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
Reply With Quote
  #5 (permalink)  
Old January 15th, 2014, 04:37 PM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Default asp uploader

have you tried http://aspuploader.com/??

I use this.. flawless. works in all browsers.

a complete alternative for you.
Reply With Quote
  #6 (permalink)  
Old January 15th, 2014, 04:45 PM
Friend of Wrox
Points: 6,664, Level: 34
Points: 6,664, Level: 34 Points: 6,664, Level: 34 Points: 6,664, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2004
Location: Sydney, NSW, Australia.
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

I think this is a better option:

http://www.persits.com/

if you use this component it does all sorts of different things. FileUplods and Email Attachments are only two of the features you will get.

As Imar mentioned there is a great pure ASP upload on this site somewhere. I did try to search for it however I couldn't find it quickly and I am a bit busy to keep looking.

While looking I noticed if you use the search without logging it it fails to give results.
__________________
Wind is your friend
Matt
Reply With Quote
  #7 (permalink)  
Old January 15th, 2014, 04:50 PM
Authorized User
Points: 483, Level: 7
Points: 483, Level: 7 Points: 483, Level: 7 Points: 483, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2007
Location: Edgewood, NY, USA.
Posts: 92
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Try this emailer with attachment. so simple!

<code>
<%
Dim myMail

Set myMail = Server.CreateObject("CDO.Message")

With myMail ' Set message attributes
myMail.Subject = "my attachment"
myMail.From = "john@happyville.com"
myMail.To = "jane@happyland.com"
Mymail.htmlBody = "Attached is my file"
'Mymail.TextBody = "Attached is my file"

' Attachment using known static physical path
'.AddAttachment "c:\somepath\somefile.txt"

' Attachment using mappath to find the physical path
.AddAttachment Server.MapPath("foldername/filename.xls")


' Send message - uncomment the following line only
' AFTER you've entered appropriate To and From
' addresses above. Then the script will actually
' send the messages.
'Send
End With
myMail.Send

Set objMessage = Nothing
%>
</code>
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
How To Import E-Mail using Classic Asp? may29adil All Other Wrox Books 0 September 29th, 2008 07:20 AM
Send mail and attachments with PHP mail function Lofa Beginning PHP 1 June 2nd, 2008 03:24 PM
Mail with Attachments software_developer_kk Classic ASP Basics 1 March 31st, 2005 12:34 AM
ASP program How to add new ID for new record kinshuk SQL Server ASP 3 March 21st, 2005 02:43 PM



All times are GMT -4. The time now is 06:10 PM.


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