1. the various MIME/Email RFCs require that there be a blank line between the last header, and the body of the email. When you send a "manual" subscription request, your sending mail client is most certainly doing "the right thing". When you pass a "normal email address" to your CGI, your recieving mail client is probably being very forgiving and parsing the msg even without that blank line. Your mailing list software is probably not as forgiving.
  2. This is why you should use modules.
  3. Please don't put this CGI any where on the Internet without seriously re-writting it. putting the "to" address in a HIDDEN form variable may seem like a good idea from a maintenance perspective, but it will just turn your site into a massive spam relay, allowing people to write scripts to use your CGI as a starting point for email to any address without any accountability as to where it orriginated from. Even if $body is something hard coded into your script, that the CGI user can't change, they can still use your script to flood someone's inbox -- and you're the one that people will go after when it happens.

In reply to Re: form+subscription+Perl+sendmail = TROLL by hossman
in thread form+subscription+Perl+sendmail = TROLL by vnomad

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.