'; $result = $db->select('contact_destinations'); if (count($result) > 0) { $destList = array(); foreach ($result as $dbRec) { //match referer to db record if (substr($_GET['ref'], 0, strlen($dbRec['ref_path'])) == $dbRec['ref_path']) { $destList[] = $dbRec['dest_email']; $headers['To'] = $dbRec['dest_email']; $headers['Subject'] = $dbRec['mail_subject']; //send out an email sendEmail($headers, $body); } } //build a list out of all matches $dbMailTo = implode(',', $destList); } //if no matches found, send to default recipient if ($dbMailTo == '') { $dbMailTo = 'marko@dppl.com'; $dbMailSubject = 'Contact from the Marsh website - please respond within 24 hours'; $headers['To'] = $dbMailTo; $headers['Subject'] = $dbMailSubject; sendEmail($headers, $body); } //save to db $rec['dest_email'] = $dbMailTo; $db->simple_insert('contact_form_data', $rec); ?>
Nimi*

Email*

Telephone
Company
Please enter your message below
 
* Mandatory field
Thank you for submitting your comments.