Forum Moderators: coopster
<body>
<div class="wrapper">
<?php if (isset($errorBD)) echo $errorBD; if (isset($errores['nombre']) || isset($errores['apellido'])||isset($errores['mail'])) {echo "Hubo algunos errores en los datos que llenaste: <a href=\"FormatoBasico.php\">Regresar al formato de inscripción?</a><br />"; if (isset($errores['nombre'])) echo $errores['nombre']; if (isset($errores['apellido'])) echo "<br />".$errores['apellido']; if (isset($errores['mail'])) echo "<br />".$errores['mail'];} else if (empty($errores)){mysql_close();
//--------------------------------------------------------------------->
//Código para enviar correo electrónico
include("class.phpmailer.php");
include("class.smtp.php"); // note, this is optional - gets called from main class if not already loaded
$correophp = new PHPMailer();
$correophp->IsSMTP();
$correophp->SMTPAuth = true; // enable SMTP authentication
$correophp->SMTPSecure = "ssl"; // sets the prefix to the servier
$correophp->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$correophp->Port = 465; // set the SMTP port
$correophp->Username = "gerardo.v.flores@gmail.com"; // GMAIL username
$correophp->Password = "jerry200346602"; // GMAIL password
$correophp->From = "gerardo.v.flores@gmail.com";
$correophp->FromName = "Webmaster Sepeal";
$correophp->Subject = "Nuevo registro en Sitio de Sepeal";
$correophp->AltBody = "This is the body when user views in plain text format"; //Text Body
$correophp->WordWrap = 50; // set word wrap
$body="<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
<title>Nuevo Registro en el sitio de Sepeal</title>
</head>";
$body.="<body>
<h3>Se ha registrado un nuevo usuario en el sitio de Sepeal</h3>
<p>Su nombre y apellidos son: ";
$body.="$nombre ";
$body.="$apellido";
$body.="</p><p>Su correo es: ";
$body.="$mail";
$body.="</p>
</body>
</html>";
$correophp->MsgHTML($body);
$correophp->AddReplyTo("gerardo.v.flores@gmail.com","Webmaster Sepeal");
//$correophp->AddAttachment("/path/to/file.zip"); // attachment
//$correophp->AddAttachment("/path/to/image.jpg", "new.jpg"); // attachment
$correophp->AddAddress("gvfb@prodigy.net.mx","Gerardo Flores");
$correophp->IsHTML(true); // send as HTML
if(!$correophp->Send()) {
$correoresult['error']= "Error en el envío del correo: "; echo $correoresult['error'];
} else {
$correoresult['bien']= '<a href="FormatoBasico.php" class="navega">Regresar al formato de inscripción</a><br />'.'<h3>Gracias por registrarte, a continuación te presento un resumen de tu perfil:</h3>'.'<p>El mensaje fue enviado al correo electrónico.</p>';
}
} if(isset($correoresult['bien'])) echo $correoresult['bien'];
?>
</div>
</body>
</html>