Checkboxes are an easy way to do it.

The value of a checkbox will only be sent if it's checked. If it's not
checked, then that variable isn't even created.

So the easiest way to do it is to use the email address as the value, and
name the checkboxes all the same name with an [] to make it an array.

<input type=checkbox value='[EMAIL PROTECTED]' name='emails[]'>
<input type=checkbox value='[EMAIL PROTECTED]' name='emails[]'>

Then, on the page that processes this form, you'll have an $emails[] array
that'll contain all of your email addresses to send to. So you just do this:

$email_string = implode(";",$emails);

If you can't pass the email addreses, directly, then you'll have to pass an
ID that relates to the email addresses. Name your checkboxes as ID[] or
something similar, and then you'll have an array of IDs to send the email

---John Holmes...

----- Original Message -----
From: "Kevin Meredith" <[EMAIL PROTECTED]>
Sent: Thursday, May 02, 2002 10:02 AM
Subject: [PHP] Multiple mails to be sent from checkbox selection

> Hi there.
> Could someone please let me know what is the best way to send multiple
> to different users collected from a checkbox on the previous page.
> There is a page that displays all the available recipients.  A users then
> selects which recipients he wants to receive the mail.  Then the next page
> should process this and send the mail off.
> I am not sure how I should me sending the checkbox name and variables and
> then how to actually insert the email addresses using the mail command.
> there a better way than using a checkbox?
> Thanks
> Kevin
> --
> PHP General Mailing List (
> To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to