PHPEMAILER CON GMAIL
HOLA AMIGOS QUE ALGUIEN ME AYUDE ESTOY UTILIZANDO UN FORMULARIO PARA ENVIAR MAIL CON PHPMAILER Y GMAIL BUENO EL PRBLEMA NO ES CON EL GMAIL SINO QUE LA FORMA ME LA PROCESA BIEN Y LOS OTROS ARCHIVOS TAMBIEN PERO CUANDO LLEGA A MAIL.PHP SE QUEDA ME HE ROTO LA CABEZA NI ENCUENTRO EL ERROR PUEDEN ENTRAR A WWW.CLICKMEDICO.NET/CONTAC1.PHP Y VER MAS O MENOS COMO VA Y AQUI LES PONGO LA PROGRAMACION DE MAIL PHP
<?
//enviar mail
$message.="<strong>"."Tipo:"."</strong> ".$tipo_contacto."<br>";
//$message.="<strong>"."Linea:"."</strong> ".$linea."<br>";
$message.="<strong>"."Nombre:"."</strong> ".$nombre."<br>";
$message.="<strong>"."Para:"."</strong> ".$para."<br>";
$message.="<strong>"."Telefono:"."</strong> ".$telefono."<br>";
$message.="<strong>"."e-mail:"."</strong> ".$email."<br>";
$message.="<strong>"."Ciudad:"."</strong> ".$ciudad."<br>";
$message.="<strong>"."Direccion:"."</strong> ".$direccion."<br>";
$message.="<strong>"."Comentarios:"."</strong> ".$comentarios."<br>";
//echo $message;
$url = "template_mail.php";
$htmlarr = file($url);
//echo $url . "<br>";
$i = 0;
while($i < count($htmlarr)) {
$mens .= $htmlarr[$i] . "n";
//echo $htmlarr[$i];
$i++;
//echo $i;
}
//$message = ereg_replace( "_", " ", $message );
$cuerpo = ereg_replace( "x1234567890", $message, $mens );
//echo 'el valor de $variable_a_debugear es:: '.$cuerpo;
//$x=mail($_REQUEST['recipient'], $subject, $cuerpo , $headers);
?>
<?
//$para = "[email protected]";
require "phpmailer/class.phpmailer.php";
$mail = new phpmailer();
$mail->PluginDir = "phpmailer/";
//require("http://www.clickmedico.net/phpmailer/class.phpmailer.php");
//$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "ssl://smtp.gmail.com"; // SMTP servers
$mail->Port = 465;
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "17013005"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Contacto Autec";
$mail->AddAddress($para,$para);
//$mail->AddAddress("[email protected]"); // optional name
$mail->AddReplyTo($para,$para);
$mail->WordWrap = 60; // set word wrap
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Contacto WEB Autec";
$mail->Body = $cuerpo;
$mail->AltBody = "";
if(!$mail->Send())
{
/*echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;*/
exit;
}
//echo "<br><br>";
//echo "Message has been sent";
?>
<?
//enviar mail
$message.="<strong>"."Tipo:"."</strong> ".$tipo_contacto."<br>";
//$message.="<strong>"."Linea:"."</strong> ".$linea."<br>";
$message.="<strong>"."Nombre:"."</strong> ".$nombre."<br>";
$message.="<strong>"."Para:"."</strong> ".$para."<br>";
$message.="<strong>"."Telefono:"."</strong> ".$telefono."<br>";
$message.="<strong>"."e-mail:"."</strong> ".$email."<br>";
$message.="<strong>"."Ciudad:"."</strong> ".$ciudad."<br>";
$message.="<strong>"."Direccion:"."</strong> ".$direccion."<br>";
$message.="<strong>"."Comentarios:"."</strong> ".$comentarios."<br>";
//echo $message;
$url = "template_mail.php";
$htmlarr = file($url);
//echo $url . "<br>";
$i = 0;
while($i < count($htmlarr)) {
$mens .= $htmlarr[$i] . "n";
//echo $htmlarr[$i];
$i++;
//echo $i;
}
//$message = ereg_replace( "_", " ", $message );
$cuerpo = ereg_replace( "x1234567890", $message, $mens );
//echo 'el valor de $variable_a_debugear es:: '.$cuerpo;
//$x=mail($_REQUEST['recipient'], $subject, $cuerpo , $headers);
?>
<?
//$para = "[email protected]";
require "phpmailer/class.phpmailer.php";
$mail = new phpmailer();
$mail->PluginDir = "phpmailer/";
//require("http://www.clickmedico.net/phpmailer/class.phpmailer.php");
//$mail = new PHPMailer();
$mail->IsSMTP(); // send via SMTP
$mail->Host = "ssl://smtp.gmail.com"; // SMTP servers
$mail->Port = 465;
$mail->SMTPAuth = true; // turn on SMTP authentication
$mail->Username = "[email protected]"; // SMTP username
$mail->Password = "17013005"; // SMTP password
$mail->From = "[email protected]";
$mail->FromName = "Contacto Autec";
$mail->AddAddress($para,$para);
//$mail->AddAddress("[email protected]"); // optional name
$mail->AddReplyTo($para,$para);
$mail->WordWrap = 60; // set word wrap
//$mail->AddAttachment("/var/tmp/file.tar.gz"); // attachment
//$mail->AddAttachment("/tmp/image.jpg", "new.jpg");
$mail->IsHTML(true); // send as HTML
$mail->Subject = "Contacto WEB Autec";
$mail->Body = $cuerpo;
$mail->AltBody = "";
if(!$mail->Send())
{
/*echo "Message was not sent <p>";
echo "Mailer Error: " . $mail->ErrorInfo;*/
exit;
}
//echo "<br><br>";
//echo "Message has been sent";
?>
