First, you can send to multiple email addresses by putting them as arguments to sendmail. That is, a space separated string.
$recipient = "foo@example.com bar@example.com";
Second, you aren't formatting the email correctly. There must be a blank line between the header and the body.

Third, you should include a To: line in the header with a list of the email addresses being sent to (separated by commas). sendmail will not add the header automatically. If you don't, the mail will show "To: undisclosed-recipients;". And probably be filtered out by spam filters. Sendmail will read the list of addresses from the To: header if you use the "-t" command line switch.


In reply to Re: Re: Re: CGI Recipient by iburrell
in thread CGI Recipient 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.