automatic mail when a page is downloaded


Can someone please help me with the sample code, to automatically send a mail to say, when some software is downloaded from my webpage ?

There will be a download link in my webpage, and when a user downloads the software, i have to get a mail indication automatically with from the user's mail configured on the machine.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From=username 'This is a variable
myMail.TextBody="You message."
myMail.Configuration.Fields.Item ("")=2
myMail.Configuration.Fields.Item ("") ="" 'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item ("") =25   'Server port


<a href="file.exe" onclick="<%=myMail.Send%>">

The above is how to csend a mail from an ASP page using CDO

CDO is used for win 2000 or later, CDONTS is used for WinNT.  Im not too sure about the link though, not sure if that will send but where code is there, to send mail all you need to do is execute the myMail.send object
For any level of reliability you will have to do it from the server.  If you do it from the client the user will have to respond to their mail client and actually send the email. Some users may not even have a mail client configured for the browse.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Leon FesterSenior Solutions ArchitectCommented:
You're going to need some serious scripting to check that condition. Once a download starts from your website, your HTML code has completed it's execution, so any mail that you would want to send would be from a page. The code above will allow you to send mail. You really need to know when the download has completed....possibly Perl, CGI could assist with monitoring the downloads.
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Also, unless the user gives you the info, you'll only know that SOMEBODY has downloaded the file. Not WHO.

The only way you're going to get any info from the user is to ask them for it. And even then there's no guarantee it's valid.
before i hash code for you, what is the capabilities of your web server ?

does your accoutn support server side scripting or jsut htmp and client side active scripting ? ?

oh and there is no way you can send email from a client users machine
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Languages and Standards

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.