<?php
/**
* Simple example script using PHPMailer with exceptions enabled
* @package phpmailer
* @version $Id$
*/

require '../class.phpmailer.php';


if ($_POST) {
	
	$subject = $_POST['subject'];
	$name = $_POST['name'];
	$email = $_POST['email'];
	$message = $_POST['message'];
   

try {
	$mail = new PHPMailer(true); //New instance, with exceptions enabled

	$body             = $message;
	$body             = preg_replace('/\\\\/','', $body); //Strip backslashes

	$mail->IsSMTP();                           // tell the class to use SMTP
	$mail->SMTPAuth   = true;                  // enable SMTP authentication
	$mail->Port       = 465;                    // set the SMTP server port
	$mail->Host       = "smtp.gmail.com"; // SMTP server
	$mail->Username   = "webmaster@superequipo.com";     // SMTP server username
	$mail->Password   = "host8888";            // SMTP server password

	$mail->IsSendmail();  // tell the class to use Sendmail

	$mail->AddReplyTo("webmaster@superequipo.com","Skylex");

	$mail->From       = "webmaster@superequipo.com";
	$mail->FromName   = $name;

	$to = $email;
	$to2 = "webmasterzzn@gmail.com";

	$mail->AddAddress($to);
	$mail->AddAddress($to2);

	$mail->Subject  = $subject;

	$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->MsgHTML($body);

$mail->AddAttachment("../examples/images/phpmailer.gif");      // attachment
$mail->AddAttachment("../examples/images/phpmailer_mini.gif"); // attachment

	$mail->IsHTML(true); // send as HTML

	$mail->Send();
	echo 'Message has been sent.';
} catch (phpmailerException $e) {
	echo $e->errorMessage();
}

}
?>