Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * Simple example script using PHPMailer with exceptions enabled
- * @package phpmailer
- * @version $Id$
- */
- require 'class.phpmailer.php';
- try {
- $mail = new PHPMailer(true); //New instance, with exceptions enabled
- $to = "saxena@aspirehairrestoration.com";
- $mail->AddAddress($to);
- $mail->From = $_POST['email'];
- $mail->FromName = $_POST['name'];
- $mail->Subject = "Contact Form";
- $body = preg_replace('/\\/','', $body); //Strip backslashes
- $mail->MsgHTML($body);
- $mail->IsSMTP(); // tell the class to use SMTP
- $mail->SMTPAuth = true; // enable SMTP authentication
- $mail->Port = 25; // set the SMTP server port
- //$mail->Host = "saxena@aspirehairrestoration.com"; // SMTP server
- //$mail->Username = "name@domain.com"; // SMTP server username
- //$mail->Password = "password"; // SMTP server password
- $mail->IsSendmail(); // tell the class to use Sendmail
- $mail->AddReplyTo("saxena@aspirehairrestoration.com");
- $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test
- $mail->WordWrap = 80; // set word wrap
- $mail->IsHTML(true); // send as HTML
- $mail->Send();
- echo 'Thank You. Your form has been submitted';
- } catch (phpmailerException $e) {
- echo $e->errorMessage();
- }
- ?>
Add Comment
Please, Sign In to add comment