1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- <?php
- include_once('./include/xTemplate/xtemplate.class.php');
- include_once('./classes/Mailer.php');
- if(!isset($_GET["correo"])){
- echo "Debes especificar la dirección a la que se enviará el correo <strong>?correo=</strong>";
- exit();
- }
- $txtCont = $_GET["txt"];
- $xtpl = new XTemplate('avisos.html');
- $xtpl->assign("CONTENIDO",$txtCont);
- $xtpl->parse("main");
- $correo = $_GET["correo"];
- //$msgInfo = "<h1>Esto es una prueba automatizada</h1><p>El correo se envió atutomáticamente, no debes hacer nada más.</p>";
- Mailer::enviarCorreo($correo,"Correo de prueba 2",$xtpl->text("main"));
- echo "Enviado!".date("H:i:s");
- /*
- try{
- //SMTP Settings
- $mail = new PHPMailer();
- $mail->CharSet = 'UTF-8';
- $mail->SMTPDebug = 0;
- $mail->SetFrom("info.ingenieria@lasalle.mx", "Correo automático"); //from (verified email address)
- $mail->Subject = "Correo de prueba"; //subject
- $mail->SMTPDebug = 1;
- $mail->isSMTP();
- $mail->SMTPAuth = true;
- $mail->SMTPSecure = 'TLS';
- $mail->Host = "smtp.office365.com";
- $mail->Port = 587;
- $mail->Username = 'info.ingenieria@lasalle.mx';
- $mail->Password = 'BDp71Fp8';
- $mail->IsHTML(true);
-
- $mail->MsgHTML($msgInfo);
- //recipient
- $mail->AddAddress($correo);
- //Success
- if ($mail->Send()) {
- echo "El correo ha sido enviado";
- }else{
-
- echo "Ocurrió un error al enviar tu información. Recarga la página e intentalo nuevamente.";
- }
- }catch(phpmailerException $e){
- echo "<h1>Error!!</h1>";
- echo $e->errorMessage();
- }*/
- ?>
|