System ErrorThis script requires that you enable the OpenSSL PHP Extension. You can do that
by uncommenting ;php_openssl.dll in your php.ini file.";
exit; // Exit the script if the extension is not found.
}
// Set these variables
$gmail_username = "username@gmail.com"; // leave @gmail.com after username
$gmail_password = "password";
$send_to = "my_email@gmail.com"; // deliver correspondence to this address
/*
User variables:
$_REQUEST['name']
$_REQUEST['email']
$_REQUEST['subject']
$_REQUEST['message']
*/
require("./phpmailer.php"); // Path to phpmailer.php
$mail = new PHPMailer();
// LOGIN
$mail->IsSMTP(); // set mailer to use SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = $gmail_username; // SMTP username
$mail->Password = $gmail_password; // SMTP password
// EMAIL FROM
$mail->From = $_REQUEST['email'];
$mail->FromName = $_REQUEST['name'];
// EMAIL TO
$mail->AddAddress($send_to);
// REPLY TO - maybe send copy to user ???
// $mail->AddReplyTo($myemail, $myname);
// You can add cc's and bcc's like this:
// $mail->AddCC("friend3@gmail.com")
// $mail->AddBCC("friend4@aol.com");
// You can add attachments like this:
// $mail->AddAttachment("/var/tmp/file.tar.gz");
// $mail->AddAttachment("/tmp/image.jpg", "new.jpg");
// Extended features set at http://phpmailer.sourceforge.net/docs/elementindex_PHPMailer.html
$date = date("l, F j, Y");
$time = date("g:ia");
$mail->WordWrap = 70; // set word wrap to 50 characters
$mail->IsHTML(true); // set email format to HTML
$messagebody = htmlentities($_REQUEST['message']);
$mail->Subject = $_REQUEST['subject'];
$mail->Body = "
Form Submission from $_SERVER[HTTP_REFERER] ---INFO------------------- Date: {$date} @ {$time} (server time) IP: {$_SERVER['REMOTE_ADDR']} ---SENDER----------------- Name: {$_REQUEST['name']} Email: {$_REQUEST['email']} ---MESSAGE---------------- {$messagebody} ---MESSAGE END------------"; // Mail NOT sent! if(!$mail->Send()) {echo "We encountered an error sending your correspondence.
". "Name: $_REQUEST[name]". ""; ?>
". "Email: $_REQUEST[email]
". "Subject: {$_REQUEST['subject']}
". "