Contact Form : Multiple Emails
Posted: Thu Sep 14, 2006 10:41 pm
Hi, I picked up a PHP contact form a little while ago (I'm inept at PHP btw) and am wondering how I would mod it to send the info to multiple email addresses.
I tried checking out the synax and adding another email by the && operator, but that didn't seem to work. (I only need to send to 2 emails)
I've also searched here and google, but haven't found anything but mass mailers.
Thanks in advance.
Code: Select all
<?php
if(!$visitormail == "" && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$badinput = "<h2>Feedback was NOT submitted</h2>\n";
}
if(empty($visitor) || empty($visitormail) || empty($notes )) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $badinput;
$todayis = date("l, F j, Y, g:i a,T") ;
$subject = $visitor;
$notes = stripcslashes($notes);
$message = " $todayis \n
Name: $visitor \n
Company: $visitorcompany \n
Phone Number: $phone \n
Message: $notes \n
From: $visitor ($visitormail)\n
----------------------------------------------------- \n
Technical information:
IP = $ip \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
mail("email@account.com", $subject, $message, $from);
?>
<span class="text">Date: <?php echo $todayis ?>
<br />
Thank You : <?php echo $visitor ?> ( <?php echo $visitormail ?> )
<br />
You will recieve a reply shortly.<br>
Your Message:<br />
<?php $notesout = str_replace("\r", "<br/>", $notes);
echo $notesout; ?>
<br />
<?php echo $ip ?></span>I've also searched here and google, but haven't found anything but mass mailers.
Thanks in advance.