D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
thread-self
/
root
/
proc
/
thread-self
/
root
/
home
/
shubmkcj
/
designpitara.com
/
ajax
/
Filename :
send-mail.php
back
Copy
<?php $spamMail = array( "admin@gmail.com","enver.solomon@childrenssociety.org.uk", "designpitara.com@buycodeshop.com", "forumhogwarts@libero.it", "james_cook78@yahoo.com", "silvi2003@alice.it", "lisa.marie.bamberger@web.de", "fortunextravision@yahoo.co.uk", "bkingss@rambler.ru", "no-replydops@gmail.com", "thorsten.kroll@freenet.de", "zicoqueen@freenet.de", "thomas.ducerf@natixis.co.uk" ); if ( in_array( trim( $_POST['email'] ), $spamMail ) ) { $validMailId = 0; } else { $validMailId = 1; } if ( $validMailId == 1 ) { if ( !filter_var( strtolower( $_POST['email'] ), FILTER_VALIDATE_EMAIL ) ) { $msg['status'] = "false"; $msg['captchaError'] = "Invalid Email Id. Please try another Mail Id."; echo json_encode( $msg ); exit(); } elseif ( !filter_var( $_POST['name'], FILTER_SANITIZE_STRING ) ) { $msg['status'] = "false"; $msg['captchaError'] = "Invalid Name Format"; echo json_encode( $msg ); exit(); } elseif ( !filter_var( $_POST['companyname'], FILTER_SANITIZE_STRING ) ) { $msg['status'] = "false"; $msg['captchaError'] = "Invalid Company Name"; echo json_encode( $msg ); exit(); } elseif ( !filter_var( $_POST['phone'], FILTER_VALIDATE_INT ) ) { $msg['status'] = "false"; $msg['captchaError'] = "Invalid Phone No"; echo json_encode( $msg ); exit(); } else { if ( isset( $_POST['g-recaptcha-response'] ) && !empty( $_POST['g-recaptcha-response'] ) ) { if ( isset( $_POST['companyname'] ) || isset( $_POST['name'] ) ) { // Get the submitted form data $txtname = filter_var( $_POST['name'], FILTER_SANITIZE_STRING ); $companyname = filter_var( $_POST['companyname'], FILTER_SANITIZE_STRING ); $email = filter_var( $_POST['email'], FILTER_VALIDATE_EMAIL ); $phone = filter_var( $_POST['phone'], FILTER_VALIDATE_INT ); $project = implode( ", ", $_POST['project'] ); $re_captcha = $_POST['g-recaptcha-response']; $secretKey = "6LeOYc8dAAAAAFQYm5rGp28LL1EY0OXJiDSCYWM2"; $ip = $_SERVER['REMOTE_ADDR']; $regDate = date( 'd-m-Y H:i' ); $response = file_get_contents( "https://www.google.com/recaptcha/api/siteverify?secret=".$secretKey."&response=".$re_captcha."&remoteip=".$ip ); $responseKeys = json_decode( $response, true ); if ( intval( $responseKeys["success"] ) !== 1 ) { $msg['status'] = "false"; $msg['msg'] = "You are spammer ! Get the @$%K out"; $msg['captchaError'] = "You are spammer ! Get the @$%K out"; exit; } else { $to = 'ravindra@designpitara.com'; //$to = 'designpitara1@gmail.com'; $from = 'contact@designpitara.com'; $fromName = 'Design Pitara'; $subject = "Let’s Start a Project Together"; $htmlContent = ' <html> <head> <title></title> </head> <body> <p><b>Company Name</b> : '.$companyname.'</p> <p><b>Service</b> : '.$project.'</p> <p><b>Name</b> : '.$txtname.'</p> <p><b>E-Mail</b> : '.$email.'</p> <p><b>Phone</b> : '.$phone.'</p> </body> </html>'; // Set content-type header for sending HTML email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; // Additional headers $headers .= 'From: '.$fromName.'<'.$from.'>' . "\r\n"; // Send email if ( mail( $to, $subject, $htmlContent, $headers ) ) { $msg['status'] = "true"; $msg['msg'] = "Query Submit Successfully . Our Team Contact You As Soon As Possible"; $msg['captchaError'] = "Query Submit Successfully . Our Team Contact You As Soon As Possible"; echo json_encode( $msg ); } else { $msg['status'] = "false"; $msg['captchaError'] = "Please Enter required fields."; echo json_encode( $msg ); } } } else { $msg['status'] = "false"; $msg['msg'] = "Please Enter required fields.". $_POST['companyname']. " ".$_POST['name']; $msg['captchaError'] = "Please Enter required fields."; exit; } } else { $msg['status'] = "false"; $msg['msg'] = "Please check on the reCAPTCHA box."; $msg['captchaError'] = "Please check on the reCAPTCHA box."; echo json_encode( $msg ); exit; } } } else { $msg['status'] = "false"; $msg['captchaError'] = "Something went wrong, Please give proper inputs!"; echo json_encode( $msg ); exit; }