function emailContentsWrapper($contents = array(), $heading = null, $subHeading = null, $footerHeading = null) { $contentsWrapper = emailHeader(); $contentsWrapper .= '<tr> <td style="background:#FFFFFF; padding:20px 0;"><table width="650" border="0" cellspacing="0" cellpadding="0" align="center" style="background:#f4f4f4;"> ' . emialHeading($heading) . emailContentsHeading($subHeading); if ($contents) { $contentsWrapper .= '<tr> <td style="padding:0 10px 10px;"> <table width="100%" border="0" cellspacing="0" cellpadding="0" style="background-color:#ffffff; border:2px solid #e6e6e6; font-family:Arial, Helvetica, sans-serif; font-size:15px; color:#000000;"> ' . emailContents($contents) . ' </table></td> </tr>'; } if ($footerHeading) { $contentsWrapper .= emailContentsHeading($footerHeading); } $contentsWrapper .= '</table></td> </tr>'; $contentsWrapper .= emailFooter(); return $contentsWrapper; }
// From $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "<br/>"; // Additional headers $headers .= 'From: ' . $_POST['name'] . '<' . $_POST['email'] . '>' . "<br/>"; $message .= emialHeading('Vous avons reçu une nouvelle index page enquête'); $message .= emailContentsHeading('Les détails sont comme ci-dessous:'); $emailData['nom'] = $_POST['name']; $emailData['Prénom'] = $_POST['prename']; $emailData['E-mail'] = $_POST['email']; $message .= emailContents($emailData); $message .= emailContentsHeading('information de la recherche:'); $message .= emailContents($searchData); $emailData = null; $emailData["Vous avez reçu un e-mail à partir d'ici "] = DEFAULT_URL; $message .= emailContents($emailData); $message = emailContentsWrapper($message); $dataArray = array('name' => $name . " " . $prename, 'email' => $email, 'phone' => $phone, 'message' => $massage, 'type' => 101, 'mail_date' => $currentTimestamp); $password = base64_encode(trim($password)); $userData = array('firstname' => $name, 'name' => mysql_real_escape_string($prename), 'email' => mysql_real_escape_string($email), 'phone_number' => mysql_real_escape_string($phone), 'password' => $password, 'created' => date('Y-m-d H:i:s')); $saveUsr = $common->save("users", $userData); if ($saveUsr) { // send enquiry to admin ... $common->save("contact", $dataArray); //Send email notification. sendSmtpMail($email, 'Merci', 'Votre demande de contact a été reçu avec succès.'); $adminEmails = $common->getAdminNotificationEmails(); foreach ($adminEmails as $emailA) { sendSmtpMail($emailA, $subject, $message); } $userqrywhrcondition = "email='" . trim($email) . "' AND password = '******'";