You must enter your name.'; exit(); } else if(trim($email) == '') { echo '
You must enter email address.
'; exit(); } else if(!isEmail($email)) { echo '
You must enter a valid email address.
'; exit(); } else if(trim($phone) == '') { echo '
You must enter a phone number.
'; exit(); } else if(trim($comments) == '') { echo '
You must enter your comments
'; exit(); } if(get_magic_quotes_gpc()) { $comments = stripslashes($comments); } // Configuration option. // Enter the email address that you want to emails to be sent to. // Example $address = "joe.doe@yourdomain.com"; //$address = "example@themeforest.net"; $address = "viktor.s@digitalforensics.com"; // Configuration option. // i.e. The standard subject will appear as, "You've been contacted by John Doe." // Example, $e_subject = '$name . ' has contacted you via Your Website.'; $e_subject = 'Contact Form - sextortion.co.uk'; // Configuration option. // You can change this if you feel that you need to. // Developers, you may wish to add more fields to the form, in which case you must be sure to add them here. $e_body = "You have been contacted by $name, their additional message is as follows." . PHP_EOL . PHP_EOL; $e_content = "\"$comments\"" . PHP_EOL . PHP_EOL; $e_reply = "You can contact $name via email, $email"; $msg = "

New message from sextortion.co.uk website contact form:

Name: ".$name."
Email: ".$email."
Phone: ".$phone."
Comments: ".$comments."

"; //$msg = wordwrap( $e_body . $e_content . $e_reply, 70 ); /*$headers = "From: $email" . PHP_EOL; $headers .= "Reply-To: $email" . PHP_EOL; $headers .= "MIME-Version: 1.0" . PHP_EOL; $headers .= "Content-type: text/plain; charset=utf-8" . PHP_EOL; $headers .= "Content-Transfer-Encoding: quoted-printable" . PHP_EOL; if(mail($address, $e_subject, $msg, $headers)) { // Email has sent successfully, echo a success page. echo "
"; echo "

Email Sent Successfully.

"; echo "

Thank you $name, your message has been submitted to us.

"; echo "
"; } else { echo 'ERROR!'; }*/ $mail = new PHPMailer(true); try { //Server settings //$mail->SMTPDebug = 2; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'smtp.office365.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'info@digitalforensics.com'; // SMTP username $mail->Password = 'gqdzwfttbhftnzvg'; // SMTP password $mail->SMTPSecure = 'tls'; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; // TCP port to connect to //Recipients $mail->setFrom('info@digitalforensics.com', 'Digital Forensics Corp'); $mail->addAddress($address); // Add a recipient $mail->addReplyTo($email, $name); // Content $mail->isHTML(true); // Set email format to HTML $mail->Subject = $e_subject; $mail->Body = $msg; //$mail->AltBody = $msg; $mail->send(); echo "
"; echo "

Email Sent Successfully.

"; echo "

Thank you $name, your message has been submitted to us.

"; echo "
"; } catch (Exception $e) { //echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; echo "Message could not be sent."; }