I can't send php generated emails to more than 1!
Posted: Fri Apr 02, 2004 10:40 am
Look please at the above script:
I try to send emails to more than one person and i cannot receive anything!
If I send to only one e.g. $pros = $m; instead of $pros = $m.",".$n;
It works!
If I write $pros="you@mydomain.com,you2@mydomain.com";
works too!
How can i make a chain of receivers by joining many variables to one ($pros)?
My PHP version is 4.1.2
I try to send emails to more than one person and i cannot receive anything!
Code: Select all
<?php
if(isset($HTTP_POST_VARS['submit'])){
if((strlen($HTTP_POST_VARS['subject'])>0) AND (strlen($HTTP_POST_VARS['body'])>0)){
$body = preg_replace("#(?<!\r)\n#s", "\n", $body);
$m="you@mydomain.com";
$n="you2@mydomain.com";
$pros = $m.",".$n;
$headers = "From: me@mydomain.com\n
To: My Friends\n
Date: ".date("D, d M Y H:i:s") . " UT\n
Reply-To:me@mydomain.com\n
Subject: ".$subject."\n
X-Mailer: PHP/".phpversion()."\n
MIME-Version: 1.0\n";
mail($pros,$subject,$body,$headers);
echo "Mail sent to $pros";
}else{
echo'<strong>You have to fill both fields</strong>';
}
}
?>It works!
If I write $pros="you@mydomain.com,you2@mydomain.com";
works too!
How can i make a chain of receivers by joining many variables to one ($pros)?
My PHP version is 4.1.2