Hi there, not a coder here but looking for help with recaptcha. I’ve got the code placed on my html form page but need help in making it work on this php page (I assume is where it needs to go) any help is appreciated:
$recipient = '[email protected]';
//$recipient = '[email protected]';
//SMTP server settings
$host = 'mail.website.ca';
$port = '587';//"587";
$username = 'ouruser';
$password = 'ourpassword';
$user_email='';
$message_body='';
$message_type='html';
try {
require './phpmailer/PHPMailerAutoload.php';
$mail = new PHPMailer();
$mail->SMTPDebug = 0;
#
# Set up connection parameters.
#
$mail->isSMTP();
$mail->Host = $host;
$mail->Port = $port;
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'tls';
$mail->Username = $username;
$mail->Password = $password;
#
# Set up the mail headers.
#
$mail->From = '[email protected]';
$mail->FromName = "Our Website";
$mail->addAddress($recipient);
#
# Build the contents of the mail message.
#
$mail->isHTML(false);
$mail->CharSet = 'utf-8';
$mail->Subject = 'Contact form for '.$_POST['Name'];
$body = "City: ".$_POST['City']."\n";
$body .= "Telephone: ".$_POST['Telephone']."\n";
$body .= "Email: ".$_POST['Email']."\n\n";
$body .= "=== Comments ===\n";
$body .= $_POST['Comments']."\n";
$mail->Body = $body;
#
# Send the message.
#
$mail->send();
header("Location:/contact_thanks.html");
die('MF000');
} catch (phpmailerException $e) {
die('MF254');
} catch (Exception $e) {
die('MF255');
}