|
<?php
// get posted data into local variables
$EmailFrom = "from@host.com ";
$EmailTo = "To_me1@yahoo.com" ;
$Subject = Trim(stripslashes($_POST['Subject']));
$Message = Trim(stripslashes($_POST['Message']));
$Email = Trim(stripslashes($_POST['Email']));
$IP = $_SERVER['REMOTE_ADDR'];
// prepare email body text
$Body = "";
$Body .= " ";
$Body .= $Message;
$Body .= "\n";
$Body .= " \n\nFrom $Email\n\n";
$Body .= "IP=$IP";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=ok.html\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.html\">";
}
?>
ok so far i have one email in the $EmailTo but how do i add another one ive tried seperating with a comma. and something with /r/n. any idea
ty
How do i add another recipient to my php script?
$EmailTo = "To_me1@yahoo.com" ;
$EmailTo2 = "To_me2@yahoo.com" ;
...
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>") && mail($EmailTo2, $Subject, $Body, "From: <$EmailFrom>") ;
|