• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 206
  • Last Modified:

automatic mail when a page is downloaded


Hi,

Can someone please help me with the sample code, to automatically send a mail to say lucky@yahoo.com, 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.

Thanks,
Lucky
0
ylucki
Asked:
ylucki
3 Solutions
 
aprestoCommented:
<%
Set myMail=CreateObject("CDO.Message")
myMail.Subject="Sending email with CDO"
myMail.From=username 'This is a variable
myMail.To="Lucky@yahoo.com"
myMail.TextBody="You message."
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing")=2
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") ="smtp.server.com" 'Name or IP of remote SMTP server
myMail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") =25   'Server port
myMail.Configuration.Fields.Update
%>

...

<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
0
 
COBOLdinosaurCommented:
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.

Cd&
0
 
Leon FesterCommented:
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.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
webwomanCommented:
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.
0
 
sanctifyCommented:
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 ? ?

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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now