Page 1 of 1

Email with multiple recipients

Posted: Fri Nov 24, 2006 5:55 am
by JimiH
Hello

I have the following code

Code: Select all

$email = "$Project_Members";
$subject = "Hello";
$message = "This is a test email";


/* Sends the mail and outputs the "Thank you" string if the mail is successfully sent, or the error string otherwise. */
if (mail($email,$subject,$message)) {
//echo "<h4>Thank you for sending email,</h4>";
} else {
echo "<h4>Can't send email to $email</h4>";
}
$Project_Members could contain upto 10 email address in a string

Example - me@me.com you@you.com them@them.com

How do you send the string using the mail() function

If I have only on email in the string it emails no problem, if there is more than one I get the following error.

"Warning: mail() [function.mail]: SMTP server response: 553 malformed address: < g.*****her@**********.co.uk paul.hi****rch@***********.co.uk>

(Names edited)

Thanks

Geoff

Posted: Fri Nov 24, 2006 5:59 am
by JimiH
Doh

Seperate by a comma :oops:

Geoff