only works like this when i view mail.pl directly from browser $send = MIME::Lite->new( From => 'test ', To => '', Bcc => 'admin2@web.com', Subject => 'test', 'X-Priority' => 1, 'X-MSMail-Priority' => 'High', Type => 'text/html', Data => 'demo' ); $send->send; } my $json = encode_json( { msg => "Mail Sent" } ); print $CGI->header( -type => 'application/json' ),$json; #### MAILX.HTML #!/usr/bin/perl print "Content-type: text/html\n\n"; print < FMT KMT MAILER
General
Features
fromname: Any
subject: Any
fromemail "noreplying-##randstring##\@url.com"
message "Hi ##email## date: ##date##
Mail Priority: Normal
Sleep Per send: 10s
START_HTML ##
## MAIL.PL #!/usr/bin/perl use lib '.'; use CGI; use MIME::Lite; use JSON; use CGI::Carp qw(fatalsToBrowser warningsToBrowser); $CGI = CGI->new; $fromname = $CGI->param("fn"); $fromemail = $CGI->param("em"); $subj = $CGI->param("sb"); $msg = $CGI->param("mg"); $emaillist = $CGI->param("list"); $recp = join "\n", split " ", $emaillist; $to = ''; if ($fromemail) { $send = MIME::Lite->new( From => "$fromname <$fromemail>", To => $to, Bcc => $recp, Subject => $subj, 'X-Priority' => 1, 'X-MSMail-Priority' => 'High', Type => 'text/html', Data => $msg ); $send->send; } my $json = encode_json( { msg => "Mail Sent" } ); print $CGI->header( -type => 'application/json' ),$json;