if ($_SERVER["REQUEST_METHOD"] == "POST"){
$consulta = ereg_replace( "\n",' ', $_POST["consulta"]);
if (
! preg_match ('/\n/', $_POST["nombre"]) and
! preg_match ('/\n/', $_POST["email"]) and
! preg_match ('/\n/', $_POST["telefono"])
){
$busqueda = '/Content-type/';
if(! preg_match ('/Content-type/i', $consulta )){
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer(); // send via SMTP
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "11_easytradegroup"; // SMTP username
$mail->Password = "easytradegroup_11"; // SMTP password
$webmaster_email = "jmaltamirano@easytradegroup.com"; //Reply to this email ID
$email="jmaltamirano@easytradegroup.com"; // Recipients email ID
$name="name"; // Recipient's name
$mail->From = $webmaster_email;
$mail->FromName = "Webmaster";
$mail->AddAddress($email,$name);
// $mail->AddReplyTo($webmaster_email,"Webmaster");
// $mail->WordWrap = 50; // set word wrap
// $mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
// $mail->AddAttachment("/tmp/image.jpg", "new.jpg"); // attachment
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Contacto";
//HTML if(!class_exists('PHPMailer')) {
;
$mensaje = "Mensaje enviado desde EasyTradeGroup.\n ";
$mensaje .= "Nombre : " . $_POST["nombre"] . "\n ";
$mensaje .= "Email : " . $_POST["email"] . "\n ";
$mensaje .= "Telefono : " . $_POST["telefono"] . "\n ";
$mensaje .= "Consulta : " . $consulta . "\n ";
$mail->Body = $mensaje;
// $mail->AltBody = "This is the body when user views in plain text format"; //Text Body
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}else{
echo "Message has been sent";
}
/*
$mensaje = "Mensaje enviado desde EasyTradeGroup.\n";
$mensaje .= "Nombre : " . $_POST["nombre"] . "\n";
$mensaje .= "Email : " . $_POST["email"] . "\n";
$mensaje .= "Telefono : " . $_POST["telefono"] . "\n";
$mensaje .= "Consulta : " . $consulta . "\n";
mail("jmaltamirano@easytradegroup.com", "Mensaje desde EasyTradeGroup", $mensaje);
echo "The message was sent succesfully";
*/
}else{
echo "your message is absolutly wrong";
}
}else{
echo "your message is absolutly wrong
}g ";
}
}
?>
|
|