Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

I have modified a form that sends email to multiple addresses, now it is only sending to the last address. Any examples of the "$to" or "print MAIL "To:". And do I need the "$to" at all? Can I just add the addresses in the "print MAIL "To:" part?

Replies are listed 'Best First'.
Re: multiple email addresses
by iburrell (Chaplain) on May 27, 2004 at 22:14 UTC
    How are you sending the email? This makes a big difference. If you are using sendmail with headers, then putting the addresses in in the To: header will work as a comma-separated list. Sendmail will look at the To: heade to figure out where to send the email. Sendmail can also take the addresses on the command line. If you are using Net::SMTP or another SMTP module, then you need to pass the destination addresses through the API, because they usually don't look at the To: header to pull off the addresses.
Re: multiple email addresses
by mifflin (Curate) on May 27, 2004 at 19:01 UTC
    can't you put one of the addresses on the TO: line and all the rest on the CC: line?
    That's what I do.
Re: multiple email addresses
by beth (Scribe) on May 27, 2004 at 21:29 UTC
    Try posting some sample code that exhibits the problem.
    eval pack("H*", "7072696e74207061636b2822482a222c202236613631373036382229");
    # japh or forkbomb? You decide!