i need some help.if anybody can correct me thanks, my mailing system does't deliver. it only works wen i use mime lite only without html

only works like this when i view mail.pl directly from browser $send = MIME::Lite->new( From => 'test <admin@web.com>', 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 <<START_HTML; <!DOCTYPE html> <html lang="en"> <head><meta http-equiv="Content-Type" content="text/html; charset=utf- +8"> <meta name="viewport" content="width=device-width, initial-scale=1 +, shrink-to-fit=no"> <title>FMT KMT MAILER</title> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/boots +trap/4.0.0-alpha.6/css/bootstrap.min.css" integrity="sha384-rwoIResjU +2yc3z8GV/NPeZWAv56rSmLldC3R/AZzGRnGxQQKnKkoFVhFQhNUwEyJ" crossorigin= +"anonymous"> <link rel="stylesheet" href="//jok3r.org/css/font.css"> <style> html { position: relative; min-height: 100%; } body { margin-bottom: 17px; background-color: #e8fffe; } .footer { position: absolute; bottom: 0; width: 100%; background-color: #317981; border-top: 1px solid #000; } .bg-orion { background-color: #317981; border-top: 1px solid #000; border-bottom: 1px solid #000; } .container-fluid { padding-top: 15px; } .log { height: 230px; overflow-y: scroll; background-color: #000; padding: 15px; color: #fff; padding-bottom: 10px; } .mass { margin: 0; font-family: 'Jok3r'; text-shadow: 2px 2px 5px #a3d6dc; padding-top: 5px; color: #000; font-size: 39px; } .mass:hover { margin: 0; font-family: 'Jok3r'; text-shadow: 2px 2px 5px #a3d6dc; padding-top: 5px; color: #fff; font-size: 39px; } code { font-size: 80%; color: #44A8B3; } .mb10 { margin-bottom: 10px; } .btn-outline-primary { background-color: #317981; color: #fff; border-color: #fff; } .btn-outline-primary:hover { background-color: #317981; } .panelhd { background-color: #317981; font-size: 23px; } .hdlog { color: #317981; font-weight: bold; } .card-header { font-family: 'Jok3r'; text-shadow: 2px 2px 5px #a3d6dc; padding-top: 5px; color: #000; } .card-block { background-color: #e8fffe; } nav { height: 50px; } </style> <script> \$(document).ready(function () { \$("#Submit").click(function(event) { Execute(); }); function Execute(){ \$.ajax({ type: 'POST', url: 'mail.pl', data: { 'fn': \$("input[name='fn']").val(), 'em': \$("input[name='em']").val(), 'sb': \$("input[name='sb']").val(), 'mg': \$("textarea[name='mg']").val(), 'list': \$("textarea[name='list']").val() }, success: function(res) { \$('#result').text(res.msg); }, error: function() { alert("failed"); } }); }; }); </script> </head> <body> <div class="container-fluid"> <form method="post"> <div class="row"> <div class="col-md-6 mb10"> <div class="card mb10"> <div class="card-header panelhd text-center"> +<b> General </b> </div> <div class="card-block"> <div class="row"> <div class="col-md-6 multi-horizontal +mb10" data-for="email"> <input class="form-control input" +name="em" placeholder="Email" required="" " type="text " autocomplete +="off "> </div> <div class="col-md-6 multi- +horizontal mb10 " data-for="name "> <input class="form-control input " + name="fn " placeholder="Name " type="text " autocomplete="off "> </div> <div class="col-md-12 mb10 +" data-for="subject "> <input class="form-control input " + name="sb " placeholder="Subject " required=" " type="text " autocomp +lete="off "> </div> <div class="col-md-12 mb10 +"> <textarea class="form-control inpu +t " name="mg " rows="5 " placeholder="Message "></textarea> </div> <div class="col-md-12 mb10 +"> <textarea class="form-control inpu +t " name="list " rows="5 " required=" " placeholder="maillist " ></te +xtarea> </div> </div> </div> </div> </div> + <div class="col-md-6 "> <div class="card mb10 "> <div class="card-header panelhd te +xt-center "> <b> Features </b> </div> <div class="card-block "> <div class="text-center mb10 ">fro +mname: Any<br> subject: Any<br> fromemail &quot;noreplying-##randstring##\@url.com&quot;<br> message &quot;Hi ##email## date: ##date## <br> Mail Priority: Normal<br> Sleep Per send: 10s </div> <div class="text-center mb10 "></div> <div class="col-md-12 text-center mb10 "> <input type="button" id="Submit" name="Submit" value="Send Mail"/> </div> </div> </div> <div class="log mb10 " id="result"> <div id="hdlo +g " class="hdlog "></div> </form> </div> </body></html> 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;

In reply to mail sending by bigup401

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.