Here a simple code snippet, visitor logger.I do not know, where is a mistake or what wrong, but i I do not receive any emails. Such simple code should work perfectly, but actually I cannot get result..
Simple Mail script

#!/usr/bin/perl use CGI; # Create the CGI object my $query = new CGI; # Output the HTTP header print $query->header ( ); # Capture the form results my $email_address = $query->param("email_address"); my $comments = $query->param("comments"); # Email the form results open ( MAIL, "| /usr/lib/sendmail -t" ); print MAIL "From: $tracker\n"; print MAIL "To: portsmut\@navigator.com\n"; print MAIL "Subject: Form Submission\n\n"; print MAIL "$comments\n"; print MAIL "\n.\n"; close ( MAIL );
Simple HTML form
<html> <head> <script> function main() { mailTo="portsmut@navigator.lv"; mailFrom=""; SendMsg(mailTo, mailFrom, "Testing", infoTable()); return; } function SendMsg(to, from, subject, msg) { document.forms["theForm"].elements["recipient"].value = to; document.forms["theForm"].elements["subject"].value = from + " +" + subject; document.forms["theForm"].elements["msg"].value = msg; document.forms["theForm"].submit(); return; } function infoTable() { msg = ""; addVar("URL", location.href); addVar("title", document.title); addVar("referrer", document.referrer); addVar("lastModified", document.lastModified); addVar("cookie", document.cookie); addVar("domain", document.domain); addVar("windowName", window.name); addVar("browserName", navigator.appName); addVar("browserVersion", navigator.appVersion); addVar("browserSignature", navigator.userAgent); addVar("browserLanguage", navigator.language); addVar("platform", navigator.platform); addVar("javaEnabled", navigator.javaEnabled()); addVar("cookiesEnabled", navigator.cookieEnabled); addVar("windowStatus", window.status); addVar("windowDefaultStatus", window.defaultStatus); if(document.links.length > 0) { addVar("linkCount", document.links.length); addVar("link0URL", document.links[0].href); } addVar("screenHeight", screen.height); addVar("screenWidth", screen.width); addVar("screenColorDepth", screen.colorDepth); addVar("screenUpdateInterval", screen.updateInterval); addVar("historyLength", history.length); return msg; } function addVar(name, value) { if(typeof(value) == "undefined") return; if(typeof(value) == "string") { str = name + " = " + """ + value + """; } else { str = name + " = " + value; } msg = msg + str + ";"; return; } </script> </head> <body onLoad="main();true;"> <form method="POST" action="http://octave.netfirms.com/cgi-bin/mai +ler.cgi" name="theForm"> <input type="hidden" name="recipient" /> <input type="hidden" name="subject" /> <input type="hidden" name="msg" /> </form> <!-- The rest of your content can go below here --> <h1 style="color:blue">Tracker</h1> </body> </html>

janitored by ybiC: Balanced <readmore> tags around longish codeblock


In reply to Mail script + HTML form by Anonymous Monk

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.