#!/usr/bin/perl # change the above to your path to perl # Enter the location of sendmail. $mailprogram = "/usr/sbin/sendmail"; # By default, BlueSend uses the page it was called from # as the url sent in email. If you only want a specific # url sent, then un-comment and use the following line. $the_url = 'http://www.indexcom.net/'; # the signature printed on the bottom of each email $sig = "Website a visitar sin falta."; #### Advanced setup options (optional) ### # Email address of person to notify when a page is sent. # Remove the comment and change this line to your email # address to enable this feature. (added by R. Betts) $notify = 'info@indexcom.net'; # The server path (NOT the url) and filename to the # logfile to log all pages sent. Remove the comment # from the following line to enable this feature. (added by R. Betts) #$logfile = '/home/sites/www.indexcom.net/web/recomendar/logfile.txt'; ### Credits ############################ # BlueSend created by: # # Robert Fogt webmaster@bluesparks.com # # # # Additional code: # # Gilnei Moraes gm199@fenomeno.com # # # # Logging and email noticing added: # # Robert Betts, bob@marinelifemag.com # # http://marinelifemag.com # # # # Send your code additions to: # # bluesend@bluesparks.com # ######################################## # version 3 print "Content-type: text/html\n\n"; &parse_form; if (!$the_url) { if ($formdata{'url'}) { $the_url = $formdata{'url'} } else { $the_url = $ENV{'HTTP_REFERER'}; } } if ($formdata{'send'}) { &check_email($formdata{'toemail'}); &check_email($formdata{'fromemail'}); $sendto = ''; $from = ''; if ($formdata{'toname'} ne '') {$sendto = $formdata{'toname'} . '<' . $formdata{'toemail'} . '>';} else {$sendto = $formdata{'toemail'};} if ($formdata{'fromname'} ne '') {$from = $formdata{'fromname'} . '<' . $formdata{'fromemail'} . '>';} else {$from = $formdata{'fromemail'};} open (MAIL,"|$mailprogram -t"); print MAIL "To: $sendto\n"; print MAIL "From: $from\n"; print MAIL "Subject: Sitio recomendado.\n\n"; if ($formdata{'toname'} ne '') { print MAIL "$formdata{'toname'},\n\n"; } print MAIL "Un amigo suyo, $formdata{'fromname'} \($formdata{'fromemail'}\)\n"; print MAIL "le surgiere que visite este sitio:\n\n"; print MAIL "$the_url\n\n"; if ($sig ne '') { print MAIL "--\n$sig\n\n"; } close(MAIL); if ($notify ne "") { # betts add Notify of page sent open (MAIL,"|$mailprogram -t"); print MAIL "To: $notify\n"; print MAIL "From: $from\n"; print MAIL "Subject: Recomendación hecha.\n\n"; print MAIL "Su sitio web ($the_url) ha sido recomendado por:\n"; print MAIL "$formdata{'fromname'} \($formdata{'fromemail'}\)\n\n"; print MAIL "a:\n"; print MAIL "$formdata{'toname'} \($formdata{'toemail'}\)\n\n"; print MAIL "--\n"; print MAIL "Con la cortesia de INDEXCOM (http://www.indexcom.net)"; close(MAIL); } if ($logfile ne "") { # betts add: do logging $date=localtime(time); if (open (MYLOG,">> $logfile")){ $logline = "$date\|$the_url\|$sendto\|$from"; print MYLOG "$logline\n"; close (MYLOG); } } &make_page('Gracias. Puede recomendar a otro amigo si lo desee.'); exit; } else { &make_page(''); } sub make_page { my $temp = shift; if ($temp ne '') {$temp = '
' . $temp . '
';} print <Rellene este formulario para enviar esta página a un amigo
$temp