관리-도구
편집 파일: enquiry_mail.php
<?php session_start(); // Required field names $required = array('userName', 'userEmail', 'phone'); // Loop over field names, make sure each one exists and is not empty $error = false; foreach($required as $field) { if (empty($_POST[$field])) { $error = true; } } if ($error) { print "<p class='Error'>Pelase fill all fields.</p>"; exit(); } $email = $_POST["userEmail"]; if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { print "<p class='Error'>Invalid email.</p>"; exit(); } if($_POST["captcha"]==$_SESSION["captcha_code"]){ $message = '<html><body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;">'; $message .= '<table rules="all" style="border-color: #666;" cellpadding="10">'; $message .= "<tr style='background: #eee;'><td><strong>Your name:</strong> </td><td>" . strip_tags($_POST['userName']) . "</td></tr>"; $message .= "<tr style='background: #eee;'><td><strong>Your e-mail:</strong> </td><td>" . strip_tags($_POST['userEmail']) . "</td></tr>"; $message .= "<tr style='background: #eee;'><td><strong>Mobile:</strong> </td><td>" . strip_tags($_POST['phone']) . "</td></tr>"; $message .= "<tr style='background: #eee;'><td><strong>Country:</strong> </td><td>" . strip_tags($_POST['country']) . "</td></tr>"; $message .= "<tr style='background: #eee;'><td><strong>Comments:</strong> </td><td>" . strip_tags($_POST['comments']) . "</td></tr>"; $message .= "</table>"; $message .= "</body></html>"; $to = "info@livithomes.com"; $userEmailList = "rakesh@livithomes.com, rashmilivit@gmail.com, sis@livithomes.com, customercare@livithomes.com, info@metexcreations.com"; // $headers .= 'Bcc: leads.evizon@gmail.com' . "\r\n"; $sender = strip_tags($_POST['userEmail']); $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // More headers $headers .= 'From: <info@livithomes.com>' . "\r\n"; // $headers .= "Reply-To:" . $sender . "\r\n"; $headers .= "Bcc: $userEmailList\r\n"; $subject = "Enquiry From: " . $sender . "\r\n"; mail($to, $subject, $message, $headers); $to1 = strip_tags($_POST['userEmail']); $subject1 = "Thank you " . strip_tags($_POST['userName']) . "\r\n"; $frm = "info@livithomes.com"; $headers1 = "From: " . $frm . "\r\n"; $headers1 .= "Reply-To: ". $frm . "\r\n"; $headers1 .= "MIME-Version: 1.0\r\n"; $headers1 .= "Content-Type: text/html; charset=ISO-8859-1\r\n"; $message1 = '<html><body style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px;">'; $message1 .= '<table border="none" rules="all" ;" cellpadding="0">'; $message1 .= "<tr style='boder:none;' ><td><strong>Dear Sir,</strong></td></tr>"; $message1 .= "<tr style='boder:none;' ><td>Thank you for your enquiry. Your mail is forwarded to our MARKETING section. We will soon contact with you Thank you.</td></tr>"; $message1 .= "<tr style='boder:none;' ><td>Regards,</td></tr>"; $message1 .= "<tr style='boder:none;' ><td> <p><strong> LIVIT HOMES</strong></p> <p>34/1806 D, Kurickal Arcade, 3rd Floor<br /> N H 47, Edappally P.O., Ernakulam<br /> Cochin - 682024.</p> <p>Tel: +91 484 2984100, 2984200<br /> Mob : +91 97445 22222, 97446 22222</p> <p>e-Mail : info@livithomes.com<br /> www.livithomes.com </p> <p></p></td></tr>"; $message1 .= "</table>"; $message1 .= "</body></html>"; if(mail($to, $subject, $message, $headers)) { //print "<p class='success'>Contact Mail Sent.</p>"; ?> <script type="text/javascript"> setTimeout("window.location='thank-you.php'",500); </script> <?php } else { print "<p class='Error'>Problem in Sending Mail.</p>"; } } else { print "<p class='Error'>Enter Correct Captcha Code.</p>"; } ?>