Mini Shell
<?php
$errors = array();
/*
// Check if name has been entered
if (!isset($_POST['name'])) {
$errors['name'] = 'Please enter your name';
}
// Check if email has been entered and is valid
if (!isset($_POST['email']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
$errors['email'] = 'Please enter a valid email address';
}
if (!isset($_POST['phone'])) {
$errors['phone'] = 'Please enter your name';
}
if (!isset($_POST['subject'])) {
$errors['subject'] = 'Please enter your name';
}
//Check if message has been entered
if (!isset($_POST['message'])) {
$errors['message'] = 'Please enter your message';
}
$errorOutput = '';
if(!empty($errors)){
$errorOutput .= '<div class="alert alert-danger alert-dismissible" role="alert">';
$errorOutput .= '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">×</span></button>';
$errorOutput .= '<ul>';
foreach ($errors as $key => $value) {
$errorOutput .= '<li>'.$value.'</li>';
}
$errorOutput .= '</ul>';
$errorOutput .= '</div>';
echo $errorOutput;
die();
}
*/
$name = $_POST['name'];
$emailpublic = $_POST['email'];
$phone = $_POST['phone'];
$subject = $_POST['subject'];
$message = $_POST['message'];
$from = $email;
########################################## SEND MAIL TO ADMINISTRATOR ##########################################
include_once("phpmailer/PHPMailerAutoload.php");
//$to = trim(RRM_ADMIN_TOEMAIL);
$email="athameventskerala@gmail.com";
$mail = new PHPMailer();
$mail->isSMTP();
$mail->SMTPDebug = 1;
$mail->SMTPKeepAlive = true;
$mail->Mailer ="smtp";
$mail->Host = 'smtp.gmail.com';
$mail->SMTPAuth = true;
$mail->Username = 'ipacertificates@gmail.com';
$mail->Password = '2014ipaadmin';
//$mail->SMTPSecure = 'ssl';
$mail->SMTPSecure = 'tls';
$mail->SMTPAutoTLS = false;
$mail->Port = 587;
$mail->setFrom("donotreply@programers.in",'ATHAM WEDDING HUB');
$mail->addAddress($email);
date_default_timezone_set('Asia/Calcutta');
$dateandtime= date("d M ,Y, h:i A");
$subject = 'athamweddinghub.com';
$mail->Subject =$subject;
$mail->isHTML(true);
$cyear=date("Y");
$body = "From: $name\n E-Mail: $emailpublic\n Phone: $phone\n Subject: $subject\n Message:\n $message";
$mail->Body = $body;
if($mail->send()){
// echo 'Sent Email Successfuly';
}
//send the email
$result = '';
if ($mail) {
$result = 'Thank You! I will be in touch';
header("Location:contact.php?msg=$result");
//echo $result;
die();
}
$result = 'Something bad happend during sending this message. Please try again later';
header("Location:contact.php?msg=$result");
//echo $result;
?>
<script type="text/javascript">
window.location.href="contact.php";
</script>
Zerion Mini Shell 1.0