#!/usr/bin/perl # # AnyMail Version 1.13 # Basic form mailer # # COPYRIGHT & CREDITS # # Copyright 2000 - 2004 Veinotte.com International Inc. # © All Rights Reserved # # # Unpublished work. # Permission granted to use and modify this script # as long as the copyright above is maintained and all modifications # are submitted to the copyright holder. # Please view the complete copyright and licensing information at # http://www.cgi.veinotte.com/copyright_license.htm # # Created September 20, 2000 # By # Barry Wayne Veinotte # http://www.veinotte.com # Last Revision: 25/09/2005 10:35:03 AM # # This script, and any other script acquired at veinotte.com, or written # by Barry Veinotte or Veinotte.com International Inc. Is to be Used # # * AT YOUR OWN RISK! * # # Veinotte.com International, Inc. and the author are not responsible for any # damages or ill effects brought about by the use of their scripts, and by using this # script you accept full responsibility for any negative consequences. # # This program has only been tested on UNIX with Perl 5 + # It requires perl 5 + # # AVAILABILITY # # The latest version of this program is available from: # # http://www.cgi.veinotte.com # # #*# Made in Canada #*# # $| = 1; use CGI qw(:param); my $script_url = $ENV{'SCRIPT_NAME'}; my $refer = $ENV{'HTTP_REFERER'}; #*# ---------- Begin Configurations ---------- #*# my $admin_address = 'you@yourdomain.com'; my $bounce_url = "http://www.yourdomain.com"; my @okay_domains = qw(veinotte.com veinotte.ca ad-eagle.com pass-iton.com); my $location_of_sendmail = '/usr/sbin/sendmail'; my $at_symbol_replacement = '~'; #*# ---------- End Configurations ---------- #*# # Nothing below this line needs to be altered # unless (param()) { print "Location: $bounce_url\n\n"; exit; } else { if (defined $refer) { my $ok = check($refer); unless ($ok == 1) { print "Location: $bounce_url\n\n"; exit; } } my $message = ""; my $goto = param("followup"); my $to = param("AnyMailAddress"); chomp $to; my $replace = '@'; $to =~ s/$at_symbol_replacement/$replace/; my ($subject_key, $subject_line, $mailngfrom); if (defined param("POSTDATA")) { print "Location: $bounce_url\n\n"; exit; } if (defined param("subject_line")) { $subject_key = param("subject_line"); $subject_line = param("$subject_key"); } else { $subject_line = "AnyMail Form Results from: $refer"; } if (defined param("FromEmail")) { $mailingfrom = param("FromEmail"); } else { $mailingfrom = "AnyMail<$admin_address>"; } foreach my $name( param() ) { unless (($name eq "followup") or ($name eq "AnyMailAddress") or ($name eq "subject_line")) { my $value = param($name); if ((defined $value) && ($value !~ /^\s*$/)) { $message .= "-------- $name --------\n$value\n\n"; } } } unless (defined $to) { $to = $admin_address; } send_mail($mailingfrom, $to, $subject_line, $message); print "Content-Type: text/html\r\n\r\n"; print qq~ AnyMail Version 1.12
Your email has been sent using AnyMail Version 1.12
AnyMail - a product of Veinotte.com





You are now being redirected to $goto

If you are not redirected shortly, please click the link above
or click here to return to the previous page.





Click here to get AnyMail for your website!










Your email has been sent using AnyMail Version 1.12
AnyMail - a product of Veinotte.com
~; exit; } sub send_mail { my ($from, $to, $subject, $messagebody) = @_; my $flags = "-t"; $mail_program = $location_of_sendmail; $mail_program .= " $flags"; open (MAIL, "|$mail_program") || die "Could Not Open Mail Program: $!"; print MAIL <<__END_OF_MAIL__; To: $to From: $from Reply-to: $from Subject: $subject X-Mailer: AnyMail 1.13 Content-type: text/plain $messagebody ___________________________________________________ Sent with AnyMail 1.13 - a product of veinotte.com __END_OF_MAIL__ close (MAIL); } # End of send_mail sub check { my $r = $_[0]; my $ok = 0; foreach $domain(@okay_domains) { if ($r =~ /.+$domain.*/) { $ok++; last; } else{ next; } } return $ok; }