Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

generate mailto: behaviour in a script

by Anonymous Monk
on Oct 07, 2007 at 10:26 UTC ( #643247=perlquestion: print w/replies, xml ) Need Help??

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I have a mailto: link in html, which opens the email client. What I would like to to is create the link to a script say, <a href="">Click here</a> and this would generate some statistics for me and then open the email client.

use LWP::Simple qw/get/; my $content = get('mailto:me\'); warn "Couldn't get it!" unless defined $content; print $content;
doesn't work - is there anything that might?

Replies are listed 'Best First'.
Re: generate mailto: behaviour in a script
by moritz (Cardinal) on Oct 07, 2007 at 11:27 UTC
    It doesn't work that way, because the get is run on the server, but you want to open the mail client at the client.

    I have no idea if non-http redirects work, but you could try to send a redirect header (with CGI::redirect) with mailto:foo@bar.baz

    A reply falls below the community's threshold of quality. You may see it by logging in.
Re: generate mailto: behaviour in a script
by snopal (Pilgrim) on Oct 07, 2007 at 15:00 UTC

    To get the response you are outlining, it seems that you need a javascript onclick solution with DHTML communication (a.k.a. AJAX) with the server. You can then acquire the click data through a hidden process, and allow the client to continue with the browser based email client.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://643247]
Approved by moritz
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (1)
As of 2020-12-05 22:53 GMT
Find Nodes?
    Voting Booth?
    How often do you use taint mode?

    Results (65 votes). Check out past polls.