hjkhhndndndnd,trt
bnmbertsu,yu,yu,fffffffy,ltdfg
/
home4
/
gofvotmy
/
public_html
/
bhavansaashray.org
/
include
/
Upload FileeE
HOME
<?php require_once('phpmailer/PHPMailerAutoload.php'); $toemails = array(); $toemails[] = array( 'email' => 'bhavansaashray@gmail.com ', // Your Email Address 'name' => 'Your Name' // Your Name ); // Form Processing Messages $message_success = 'We have <strong>successfully</strong> received your Message and will get Back to you as soon as possible.'; // Add this only if you use reCaptcha with your Contact Forms $recaptcha_secret = ''; // Your reCaptcha Secret $mail = new PHPMailer(); // If you intend you use SMTP, add your SMTP Code after this Line if( $_SERVER['REQUEST_METHOD'] == 'POST' ) { if( $_POST['template-contactform-email'] != '' ) { $name = isset( $_POST['template-contactform-name'] ) ? $_POST['template-contactform-name'] : ''; $email = isset( $_POST['template-contactform-email'] ) ? $_POST['template-contactform-email'] : ''; $phone = isset( $_POST['template-contactform-phone'] ) ? $_POST['template-contactform-phone'] : ''; $address = isset( $_POST['template-contactform-address'] ) ? $_POST['template-contactform-address'] : ''; $subject = isset($subject) ? $subject : 'Enquiry Form Contact us'; $botcheck = $_POST['template-contactform-botcheck']; if( $botcheck == '' ) { $mail->SetFrom( $email , $name ); $mail->AddReplyTo( $email , $name ); foreach( $toemails as $toemail ) { $mail->AddAddress( $toemail['email'] , $toemail['name'] ); } $mail->Subject = $subject; $name = isset($name) ? "Name: $name<br><br>" : ''; $email = isset($email) ? "Email: $email<br><br>" : ''; $phone = isset($phone) ? "Phone No.: $phone<br><br>" : ''; $address = isset($address) ? "Address: $address<br><br>" : ''; $referrer = $_SERVER['HTTP_REFERER'] ? '<br><br><br>This Form was submitted from: ' . $_SERVER['HTTP_REFERER'] : ''; $body = "$name $email $phone $address $referrer"; // Runs only when File Field is present in the Contact Form if ( isset( $_FILES['template-contactform-file'] ) && $_FILES['template-contactform-file']['error'] == UPLOAD_ERR_OK ) { $mail->IsHTML(true); $mail->AddAttachment( $_FILES['template-contactform-file']['tmp_name'], $_FILES['template-contactform-file']['name'] ); } $mail->SMTPDebug = 3; // Enable verbose debug output // $mail->isSMTP(); // Set mailer to use SMTP $mail->CharSet="iso-8859-1"; $mail->Host = 'md-in-31.webhostbox.net'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'support@imctek.in'; // SMTP username $mail->Password = 'SUTpass2019@'; // SMTP password $mail->SMTPSecure = 'ssl'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 465; // TCP port to connect to $mail->From = 'bhavansaashray@gmail.com'; $mail->FromName = 'Enquiry Form Contact us'; $mail->addAddress('bhavansaashray@gmail.com'); // Add a recipient $mail->addReplyTo('bhavansl@hotmail.com'); $mail->addCC('bhavansl@hotmail.com'); $mail->addBCC('bhavansaashray@gmail.com'); // Runs only when reCaptcha is present in the Contact Form if( isset( $_POST['g-recaptcha-response'] ) ) { $recaptcha_response = $_POST['g-recaptcha-response']; $response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify?secret=" . $recaptcha_secret . "&response=" . $recaptcha_response ); $g_response = json_decode( $response ); if ( $g_response->success !== true ) { echo '{ "alert": "error", "message": "Captcha not Validated! Please Try Again." }'; die; } } $mail->MsgHTML( $body ); $sendEmail = $mail->Send(); if( $sendEmail == true ): header( "Location: ../thanks.htm" ); else: echo '{ "alert": "error", "message": "Email <strong>could not</strong> be sent due to some Unexpected Error. Please Try Again later.<br /><br /><strong>Reason:</strong><br />' . $mail->ErrorInfo . '" }'; endif; } else { echo '{ "alert": "error", "message": "Bot <strong>Detected</strong>.! Clean yourself Botster.!" }'; } } else { echo '{ "alert": "error", "message": "Please <strong>Fill up</strong> all the Fields and Try Again." }'; } } else { echo '{ "alert": "error", "message": "An <strong>unexpected error</strong> occured. Please Try Again later." }'; } ?>