?
Path : /home/admin/public_html/include/class_mail/ |
Current File : /home/admin/public_html/include/class_mail/send_contactus.php |
<?php session_start(); if( isset($_POST['submit'])) { if( $_SESSION['security_code'] == $_POST['security_code'] && !empty($_SESSION['security_code'] ) ) { unset($_SESSION['security_code']); require("class.phpmailer.php"); $mail = new PHPMailer(); $mail->IsSMTP(); $mail->Host = "mail.happykoreamall.com"; $mail->From = $email; $mail->FromName = $name; $mail->AddAddress("info@happykoreamall.com", "Contact us From :: ".$email); $mail->AddReplyTo("info@happykoreamall.com", "Contact us From :: ".$email); $mail->WordWrap = 100; $mail->IsHTML(true); $mail->Subject = "Contact US From ".strtoupper("happykoreamall.com")." :: ".$subject; $body="<html><head><title></title>"; $body.="<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"; $body.="<style type=\"text/css\">"; $body.="<!--"; $body.="body {"; $body.=" font-family: Verdana;"; $body.=" font-weight: bold;"; $body.=" font-size: 10px;"; $body.=" color: #666666;"; $body.="}"; $body.=".style1 {"; $body.=" font-family: Verdana;"; $body.=" font-weight: bold;"; $body.=" font-size: 10px;"; $body.=" color: #666666;"; $body.="}"; $body.="-->"; $body.="</style>"; $body.="</head><body><table width=\"400\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">"; $body.=" <tr>"; $body.=" <td colspan=\"2\" align=\"center\"><span class=\"style1\">Contact from HAPPYKOREAMALL.COM </span><BR><hr noshade></td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td width=\"141\" align=\"right\" class=\"style1\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">Date/Time :</td>"; $body.=" <td width=\"259\" class=\"style1\">".date("j M Y H:i",mktime( date("H"), date("i") ))."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td class=\"style1\" align=\"right\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">IP Address :</td>"; $body.=" <td class=\"style1\">".getenv("REMOTE_ADDR")."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td class=\"style1\" align=\"right\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">Subject :</td>"; $body.=" <td class=\"style1\">".$subject."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td class=\"style1\" align=\"right\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">Name :</td>"; $body.=" <td class=\"style1\">".$name."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td class=\"style1\" align=\"right\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">Phone :</td>"; $body.=" <td class=\"style1\">".$tel."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td class=\"style1\" align=\"right\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">E-mail :</td>"; $body.=" <td class=\"style1\">".$email."</td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td valign=\"top\" align=\"right\" class=\"style1\" style=\"background-color: '#CCCCCC'; padding-Right: 3px;\">Detail :</td>"; $body.=" <td valign=\"top\" class=\"style1\"><pre>".$messages."</pre></td>"; $body.=" </tr>"; $body.=" <tr>"; $body.=" <td colspan=\"2\" align=\"center\"><hr noshade></td>"; $body.=" </tr>"; $body.="</table></body></html>"; $mail->Body = $body; if(!$mail->Send() && !empty($subject) && !empty($name) && !empty($tel) && !empty($email) && !empty($messages)) { $txt_msg= "<br>Message could not be sent. <p>Mailer Error : ".$mail->ErrorInfo."<br><br>"; }else{ $txt_msg= "<br>Message has been sent.<br><br>"; } } else { $txt_msg='Sorry, you have provided an invalid security code'; } } //echo $txt_msg; echo '<script>document.location.href=\'../../contactus.php?chk_msg=sec_code_err&txt_msg='.$txt_msg.'\';</script>' ?>