Can't see other recipient in To field when email is received
Hi Ray, I've added some custom coding to a Universal Email script because I need to email specific people depending on which postcode is entered. My code is as follows:
<?php
if (isset($_POST["submit"]) || isset($_POST["submit_x"])) { //WA Universal Email
$Email = new WA_Email("call-me_2");
$Email->Redirect = "?sent=true";
$Email->From = "MyCompany<enquiries@mycompany.co.uk>";
if(in_array($_POST['area'], ["BN-", "BR-", "CR-", "CT-", "DA-", "GU-", "IG-", "KT-", "ME-", "PO-", "RH-", "RM-", "SM-", "SO-", "SS-", "TN-", "TW-"], TRUE)) {
$Email->addTo("john@mycompany.co.uk");}
if(in_array($_POST['area'], ["BB-", "BD-", "BL-", "CA-", "CW-", "DN-", "FY-", "HD-", "HG-", "HU-", "HX-", "L-", "LA-", "LS-", "M-", "OL-", "PR-", "S-", "SK-", "WA-", "WF-", "WN-", "YO-"], TRUE)) {
$Email->addTo("paul@mycompany.co.uk");}
if(in_array($_POST['area'], ["CB-", "CF-", "CH-", "CM-", "CO-", "DE-", "DY-", "HR-", "IP-", "LD-", "LE-", "LL-", "LN-", "NG-", "NN-", "NP-", "NR-", "PE-", "SA-", "SG-", "ST-", "SY-", "TF-", "WS-", "WV-"], TRUE)) {
$Email->addTo("ringo@mycompany.co.uk");}
if(in_array($_POST['area'], ["AL-", "B-", "BA-", "BH-", "BS-", "CV-", "DT-", "EN-", "EX-", "GL-", "HA-", "HP-", "LU-", "MK-", "OX-", "PL-", "RG-", "SL-", "SN-", "SP-", "TA-", "TQ-", "TR-", "UB-", "WD-", "WR-"], TRUE)) {
$Email->addTo("george@mycompany.co.uk");}
if(in_array($_POST['area'], ["AB-", "BT-", "DD-", "DG-", "DH-", "DL-", "EH-", "FK-", "G-", "HS-", "IV-", "KA-", "KW-", "KY-", "ML-", "NE-", "PA-", "PH-", "SR-", "TD-", "TS-", "ZE-"], TRUE)) {
$Email->addTo("yoko@mycompany.co.uk");}
if(in_array($_POST['area'], ["E-", "EC-", "N-", "NW-", "SE-", "SW-", "W-", "WC-"], TRUE)) {
$Email->addTo("john@mycompany.co.uk");
$Email->addTo("paul@mycompany.co.uk");}
$Email->addTo("info@mycompany.co.uk");
$Email->BodyFile = "webassist/email/call-me.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "Booking with Manager";
$Email->send($emailGroup);
}
$Email->close();
}
?>
The emails send fine, however I want info@mycompany.co.uk to be able to see in their email who else the email has been sent to. Both the main recipient and info@ are reporting that they can only see their own email address in the To field when they receive the email. I didn't add it as a CC because I'm thinking if the To field was blank for whatever reason, it wouldn't send with just a CC - is that correct?