Sorry, the php code for sendmail.php is:
`<?php
require_once('phpmailer/PHPMailerAutoload.php');
$toemails = array();
$toemails[] = array(
'email' => 'xxxx', // Your Email Address
'name' => 'xxxx' // Your Name
);
// Form Processing Messages
$message_success = 'Your brief has been **successfully ** received and will now be processed. Thank you.';
// Add this only if you use reCaptcha with your Contact Forms
$recaptcha_secret = ''; // Your reCaptcha Secret
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = "smtpout.europe.secureserver.net";
$mail->SMTPDebug = 0;
$mail->SMTPAuth = true;
$mail->Host = "smtpout.europe.secureserver.net";
$mail->Port = 80;
$mail->Username = "xxxx";
$mail->Password = "xxxx";
// If you intend you use SMTP, add your SMTP Code after this Line
if( $_SERVER['REQUEST_METHOD'] == 'POST' ) {
if( $_POST['contactform-jobnumber'] != '' ) {
$jobnumber = isset( $_POST['contactform-jobnumber'] ) ? $_POST['contactform-jobnumber'] : '';
$client = isset( $_POST['contactform-client'] ) ? $_POST['contactform-client'] : '';
$projecttitle = isset( $_POST['contactform-projecttitle'] ) ? $_POST['contactform-projecttitle'] : '';
$requestedby = isset( $_POST['contactform-requestedby'] ) ? $_POST['contactform-requestedby'] : '';
$reviewdate = isset( $_POST['contactform-reviewdate'] ) ? $_POST['contactform-reviewdate'] : '';
$finaldeadline = isset( $_POST['contactform-finaldeadline'] ) ? $_POST['contactform-finaldeadline'] : '';
$maxtimeallowed = isset( $_POST['contactform-maxtimeallowed'] ) ? $_POST['contactform-maxtimeallowed'] : '';
$assetsorlead = isset( $_POST['contactform-assetsorlead'] ) ? $_POST['contactform-assetsorlead'] : '';
$projecttype = isset( $_POST['contactform-projecttype'] ) ? $_POST['contactform-projecttype'] : '';
$serverlocation = isset( $_POST['contactform-serverlocation'] ) ? $_POST['contactform-serverlocation'] : '';
$clientoverview = isset( $_POST['contactform-clientoverview'] ) ? $_POST['contactform-clientoverview'] : '';
$othercomments = isset( $_POST['contactform-othercomments'] ) ? $_POST['contactform-othercomments'] : '';
$subject = isset($subject) ? $subject : 'New Creative Brief Received';
$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;
$jobnumber = isset($jobnumber) ? "Job Number: $jobnumber<br><br>" : '';
$client = isset($client) ? "Client: $client<br><br>" : '';
$projecttitle = isset($projecttitle) ? "Project Title: $projecttitle<br><br>" : '';
$requestedby = isset($requestedby) ? "Requested By: $requestedby<br><br>" : '';
$projecttype = isset($projecttype) ? "Project Type: $projecttype<br><br>" : '';
$reviewdate = isset($reviewdate) ? "Review Date: $reviewdate<br><br>" : '';
$finaldeadline = isset($finaldeadline) ? "Final Deadline: $finaldeadline<br><br>" : '';
$maxtimeallowed = isset($maxtimeallowed) ? "Maximum Time Allowed (Hours): $maxtimeallowed<br><br>" : '';
$assetsorlead = isset($assetsorlead) ? "Existing Assets or Creative Lead: $assetsorlead<br><br>" : '';
$serverlocation = isset($serverlocation) ? "Location on Server of files: $serverlocation<br><br>" : '';
$clientoverview = isset($clientoverview) ? "Client Overview: $clientoverview<br><br>" : '';
$othercomments = isset($othercomments) ? "Other Comments: $othercomments<br><br>" : '';
$referrer = $_SERVER['HTTP_REFERER'] ? '<br><br><br>This Form was submitted from: ' . $_SERVER['HTTP_REFERER'] : '';
$body = "$jobnumber $client $projecttitle $requestedby $projecttype $reviewdate $finaldeadline $maxtimeallowed $assetsorlead $serverlocation $othercomments ";
// Runs only when File Field is present in the Contact Form
if ( isset( $_FILES['contactform-file'] ) && $_FILES['contactform-file']['error'] == UPLOAD_ERR_OK ) {
$mail->IsHTML(true);
$mail->AddAttachment( $_FILES['contactform-file']['tmp_name'], $_FILES['contactform-file']['name'] );
}
if ( isset( $_FILES['contactform-file'] ) && $_FILES['contactform-file2']['error'] == UPLOAD_ERR_OK ) {
$mail->IsHTML(true);
$mail->AddAttachment( $_FILES['contactform-file2']['tmp_name'], $_FILES['contactform-file2']['name'] );
}
// 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 ):
echo '{ "alert": "success", "message": "' . $message_success . '" }';
else:
echo '{ "alert": "error", "message": "Email **could not** be sent due to some Unexpected Error. Please Try Again later.<br /><br />**Reason:**<br />' . $mail->ErrorInfo . '" }';
endif;
} else {
echo '{ "alert": "error", "message": "Bot **Detected**.! Clean yourself Botster.!" }';
}
} else {
echo '{ "alert": "error", "message": "Please **Fill up** all the Fields and Try Again." }';
}
} else {
echo '{ "alert": "error", "message": "An unexpected error occured. Please Try Again later." }';
}
?>