Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

php form

Status
Not open for further replies.

edd1e19

Programmer
Mar 22, 2004
72
GB
hi there,

I am using this code that is used for a form, that gets sent to an email address, but i would like to be able to send this form to multiple email addresses instead of the one, does anyone know what to do?

<?php
$myemail = "somebody@tiscali.co.uk";

if (!isset($_POST))
{
echo "Somebody Goofed $ip" ;
}
else
{
$todayis = date("l, F j, Y, g:i a") ;

$subject = "Enquiry" ;

$message = $todayis . " [EST] \n
Email: ".$_POST['email']." \n
Address: ".$_POST['address']." \n
Phone: ".$_POST['phone']." \n
Fax: ".$_POST['fax']." \n
Name: ".$_POST['name']." (".$_POST['message'].")\n";

$from = "From: $myemail\r\n";

if ($myemail != "")
{
mail($myemail, $subject, $message, $from);
}
}
?>


thanks

edd
 
$myemail="address_1;address_2...address_n";

Bastien

Cat, the other other white meat
 
hi there,

I tried this:

$myemail="somebody@tiscali.co.uk;somebody@tiscali.co.uk";

But still is not working

thanks

edd



 
Actually, most mail clients can't use semicolons to separate multiple recipients. Outlook is the only one that does as far as I know.

Most mail clients use commas to separate recipients, and so does the example code on the MySQL page for the mail() function.


Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top