Hi,
Please can someone show me how to add more than one forwarding email in a ?
Would the following work:PHP Code:$EmailTo = "info@myemailaddress.co.uk"; "accounts@myemailaddress.co.uk";
Printable View
Hi,
Please can someone show me how to add more than one forwarding email in a ?
Would the following work:PHP Code:$EmailTo = "info@myemailaddress.co.uk"; "accounts@myemailaddress.co.uk";
You didn't really provide enough info to truly help you, but I am assuming you're using the mail(). So in that case you use , not ;
Check out the php manual for it here - http://www.php.net/manual/en/function.mail.php
PHP Code:$EmailTo = "info@myemailaddress.co.uk", "accounts@myemailaddress.co.uk"
thanks for your reply fastsol1.
I only included the part of the php script that refers to where emails from the website contact form are directed. Here is the complete script from the contact engine if that is more helpful. I just want to add in a second email address for enquiries to be sent to.
PHP Code:<?php
$EmailFrom = "My Website";
$EmailTo = "info@myemailaddress.co.uk";
$Subject = "A Message From Your Website";
$Name = Trim(stripslashes($_POST['Name']));
$Tel = Trim(stripslashes($_POST['Tel']));
$Email = Trim(stripslashes($_POST['Email']));
$Message = Trim(stripslashes($_POST['Message']));
// validation
$validationOK=true;
if (!$validationOK) {
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
exit;
}
// prepare email body text
$Body = "";
$Body .= "Name: ";
$Body .= $Name;
$Body .= "\n";
$Body .= "Tel: ";
$Body .= $Tel;
$Body .= "\n";
$Body .= "Email: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Message: ";
$Body .= $Message;
$Body .= "\n";
// send email
$success = mail($EmailTo, $Subject, $Body, "From: <$EmailFrom>");
// redirect to success page
if ($success){
print "<meta http-equiv=\"refresh\" content=\"0;URL=contactthanks.php\">";
}
else{
print "<meta http-equiv=\"refresh\" content=\"0;URL=error.htm\">";
}
?>
Try them separated with commas (in one pair of quotes);
Code:$EmailTo = "info@myemailaddress.co.uk, accounts@myemailaddress.co.uk";