#!/usr/bin/perl -w use MIME::Base64; use MIME::QuotedPrint; use Mail::Sendmail; use CGI qw(:standard); use CGI::Carp qw/ fatalsToBrowser /; # remove for production my $cgi = new CGI; print $cgi->header; print $cgi->start_html(); #get values as below my $a_File = $cgi->param('image'); ... if($a_File =~ m!/!){ @data = split /\//, $a_File; $a_Filename = pop @data; }elsif($a_File =~ m!\\!){ @data = split /\\/, $a_File; $a_Filename = pop @data; }else{ $a_Filename = $a_File; } if ($a_Filename){ open(a_tmpFile, "){ $base64_a_File = $base64_a_File . encode_base64($_); } close a_tmpFile; } ########### MESSAGE ##################### %mail = ( SMTP => '', from => '', to => '', subject => '', ); $boundary = "====" . time() . "===="; $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\""; $boundary = '--'.$boundary; $mail{body} = <Thank You."; #END