All Scripts backed by 10 years in business, free support, free updates and a 30 day money back guarantee.
Download Purchase Programming F.A.Q. Support Contact
Commercial Perl Scripts
All Form Pro Updated
Count It
Form Mailer + Attachments
Client File Manager
Da Godfaddah
Dropbox Updated
FAQ Builder
HT Manager Updated
RegisterHT
Mailing List Server
Page Updater - Text
Page Updater Pro Updated
PS Guestbook Updated
PS Lightning Search Updated
Quick File Mailer
Quick MySQL
Select-A-File
Upload Center
Free Perl Scripts
Access Log Viewer
All Form
Epoch Converter
Error Log Viewer
Invoice Center
PS Upload
Question Manager
Quick CHMOD
QuickHT
Site File Finder
Site File Lister
SSI Tag Maker
Perl Modules
Monger Calendar
Monger File
Monger Mail
Monger Persist
JavaScript Generators
PopUp Windows
Meta Gen
RGB / Hex Converter
Page Colors
Sudoku
Tutorials and FAQs
Cookies
Using CuteFTP
Using WS_FTP
Installing Scripts
Debugging
Utilities
env_vars.pl
backup.pl
restore.pl
check_email.pl
date.pl
dayname.pl
fileage.pl
format_length.pl
format_url.pl
getfile.pl
parse.pl
redirect_html.pl
Free Services
Epoch Converter
TLD Registries
RGB/Hex FInder
Colour Checker
ASCII Codes
Policies
Terms and Conditions
Privacy Policy
Refund Policy
Site Map

Form Processor with no SPAM from robots.

Anti-spam, anti-robot, anti-flame, Guestbook for your website.

Manage Remote websites from your website. Allow clients to update sections of their own web pages.

Secure file manager with upload progress meter. A printer's best friend. Find out more.

MongerMail

MongerMail is an object oriented module that will permit you to send e-mails from your perl program with attachements, using sendmail.

MongerMail is a self contained module that does not require any othermodules to function. It was written to be placed in your webspace with the program calling it. It does NOT have to be installed on the server. Simply place it in the same directory as the program calling it.

MongerMail makes the process of sending attached documents (ASCII or Binary) from your Perl program as easy as possible. It even allows you to easily specify HTML format for the outgoing mail. First, fill in your e-mail address below, select a file, then send it to yourself (we don't track your emails nor do we store them, this is a demo only). Once you have done that, you will be re-directed back to this page.

Version .02 is now in distribution. Minor changes in the coding have sent the benchmarks through the roof! For example, we have tested monger mail with creating true attachments up to 19.5Mb (Yes, Mb, not Kb) in size.

Enter your email address:
Select a file:



Next, have look at the code below. This is the EXACT code that is used in the above demo. You will see how unbelievably easy this is to use:

BEGIN TRANSCRIPT
================================================
#!/usr/bin/perl

#######################################################################
#
#	MongerMail Demo Script
#	2000, Perl Services
#
#######################################################################
#
#					VARIABLES

%file = (
    '1' => 'santaplane.jpg',
    '2' => 'mongermail_demo.pl',
    '3' => 'MongerMail.pm',
    '4' => 'jim.jpg'
);

$admin_email = 'youremail@email.com';

$subject = 'Here is the file you requested';

$file_directory = '/usr/local/put/your/path/here';

$mail_program = "/usr/sbin/sendmail";

#
#######################################################################
#

&Parse;

$ScriptURL = "http://$ENV{'SERVER_NAME'}$ENV{'SCRIPT_NAME'}";

if($FORM{action} eq 'send') {
    if(check_email($FORM{'email'})) {
	use MongerMail;
	my $mail = new MongerMail($mail_program);
	$mail->to($FORM{email});
	$mail->from($admin_email);
	$mail->subject($subject);
	$mail->content("Here is the demonstration file. It was mailed to you\nby utilizing MongerMail. Enjoy!");
	$mail->attachment("$file_directory/$file{$FORM{filename}}");
	$mail->send;
	print "Content-type: text/html\n\n";
	print "<BR><BR><BR><B>Thank You! The file has been mailed!</B>";
	print "<BR><BR><BR><A HREF=\"http://www.perlservices.net/en/modules/MongerMail.shtml\"><B><<<< Back</B></A>\n";

    } else {
	print "Content-type: text/html\n\n";
	print "<BR><BR><BR>OOPS! The e-mail address you entered was not in a valid email address format.";
	print "<BR><BR><BR><A HREF=\"http://www.perlservices.net/en/modules/MongerMail.shtml\"><B><<<< Back</B></A>\n";
    }
} else {
    print "Content-type: text/html\n\n";
    print "<BR><BR><BR>HEY! You attempted to call this program incorrectly.";
    print "<BR><BR><BR><A HREF=\"http://www.perlservices.net/en/modules/MongerMail.shtml\"><B><<<< Back</B></A>\n";
}

exit;

sub check_email {
    my($fe_email) = $_[0];
    if($fe_email) {
        if(($fe_email =~ /(@.*@)|(\.\.)|(@\.)|(\.@)|(^\.)|(\.$)/) ||
	    ($fe_email !~ /^.+@\[?(\w|[-.])+\.[a-zA-Z]{2,3}|[0-9]{1,3}\]?$/)) {
	    return(0);
        }
        else {return(1)}
    }
    else {
    	return(0);
    }
}

sub Parse {
    local($name, $value, $buffer, $pair, $hold, @pairs);

    if($ENV{'REQUEST_METHOD'} eq 'GET') {
        @pairs = split(/&/, $ENV{'QUERY_STRING'});
    } else {
        read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
        @pairs = split(/&/, $buffer);
    }
    foreach $pair (@pairs) {
	($name, $value) = split(/=/, $pair);
	$value =~ tr/+/ /;
	$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
	$name =~ s/\n//g;
	$name =~ s/\r//g;
	$value =~ s/\n//g;
	$value =~ s/\r//g;

      #This section checks the value portion (user input) of
      #all name/value pairs.
	$value =~ s/<.+>?//g;
	$value =~ s/\|//g;
	$value =~ s///g;
	$value =~ s/\s-\w.+//g;
	$value =~ s/\0//g;
	$value =~ s/\|//g;
	$value =~ s/\\//g;
	$value =~ s/system\(.+//g;
	$value =~ s/grep//g;
	$value =~ s/\srm\s//g;
	$value =~ s/\srf\s//g;
	$value =~ s/\.\.([\/\:]|$)//g;
	$value =~ s/< *((SCRIPT)|(APPLET)|(EMBED))[^>]+>//ig;

      #This section checks the value portion (from element name) of
      #all name/value pairs. This was included to prevent any nasty
      #surprises from those who would hijack you forms!
        $name =~ s/<.+>?//g;
	$name =~ s///g;
	$name =~ s/^\s-\w.+//g;
	$name =~ s/\0//g;
	$name =~ s/\|//g;
	$name =~ s/\\//g;
	$name =~ s/system\(.+//g;
	$name =~ s/grep//g;
	$name =~ s/\srm\s//g;
	$name =~ s/\srf\s//g;
	$name =~ s/\.\.([\/\:]|$)//g;
	$name =~ s/< *((SCRIPT)|(APPLET)|(EMBED))[^>]+>//ig;

	$FORM{$name} = $value;
    }
}
TD> END TRANSCRIPT
===================================================




Download MongerMail.pm

  ©2009 All rights reserved, PerlServices.net. Website hosting by LinuxHostingPlans.com