automatic mail when a page is downloaded

Posted on 2004-12-01
Last Modified: 2010-04-06


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.

Question by:ylucki
    LVL 23

    Expert Comment

    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
    LVL 53

    Accepted Solution

    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.

    LVL 26

    Assisted Solution

    by:Leon Fester
    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.
    LVL 19

    Assisted Solution

    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.
    LVL 1

    Expert Comment

    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 ? ?

    LVL 1

    Expert Comment

    oh and there is no way you can send email from a client users machine

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
    JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    14 Experts available now in Live!

    Get 1:1 Help Now