in reply to Re: Re: CGI Recipient
in thread CGI Recipient

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.

Replies are listed 'Best First'.
Re: Re: Re: Re: CGI Recipient
by Anonymous Monk on Mar 09, 2004 at 13:53 UTC
    It is not sending to the multiple email addresses that I am having a problem with, although, your tip on the formatting is a huge help. What I am looking for is to take the field
    print MAIL "<b>US Citizen? </b>$FORM{'ckusyes'} $FORM{'ckusno'}<br>";
    When the 'ckusno' is true or slected then an additional email recipient is added. I don't want to inundate the additional recipient with every form, only when this field is valid. Thanks,