[#] hm X_Shell Backd00r [#]
<?php
require_once 'conexion.class.php';
require_once '../library/mail/class.phpmailer.php';
class Reenvio{
public $nombre;
public $correo;
public $codigo;
public $promo;
public $tipo;
public function __construct(){
$this->conex = Conexion::singleton_conexion();
}
public function get_usuarios(){
try {
$sql = "SELECT * FROM registro WHERE codigo = :cod";
$query = $this->conex->prepare($sql);
$query->execute(array(":cod"=>$this->codigo));
$res = $query->fetchAll(PDO::FETCH_ASSOC);
if($query->rowCount()>0) return $res;
else return false;
} catch (PDOException $e) {
print "Error :".$e->getMessage();
}
}
public function sendMail(){
$destino = $this->correo;
$aux = $this->tipo;
switch ($aux) {
case 'auto':
$msj = "Track day Auto";
break;
case 'moto':
$msj = "Track day Moto";
break;
case 'Arrancones':
$msk = "Arrancones Nocturnos";
break;
}
$from = "Autodromo Intl. Miguel E. Abed";
$body = '<html>
<head>
<title>Autodromo</title>
<meta http-equiv=\"\" content=\"text/html; charset=iso-8859-1\">
</head>
<body style="font-family:Arial, Helvetica, sans-serif; max-width:970px">
<img src="http://www.autodromomabed.com/buen-fin/img/buen-fin-banner.jpg" alt="">
<p style="text-align:center;font-size:"><strong>Muchas gracias por su registro</strong></p>
<p style="text-align:center;font-size:35px;font-weigth:bold;">Código de registro</p>
<div style="text-align:center;padding: 27px 29px;background-color: #d2d2d2;font-size: 25px;">'.$this->promo.'<br>'.$this->codigo.'</div>
<p style="text-align:center;font-size:30px;font-weigth:bold;"><strong>'.$msj.'</strong></p>
<p>Por medio de este correo se informa que ha quedado registrado. Para hacer válida la promoción "'.$this->promo.'" en los eventos de pista abierta de Noviembre/Diciembre, se notifíca que este Código de seguridad tiene que ser presentado impreso el dia del evento en el Autódromo, de no ser asi, la promoción no será válida para la persona registrada</p>
</body>
</html>';
$mail = new PHPMailer(true);
$mail->IsSMTP();
try {
$mail->SMTPAuth=true;
$mail->SMTPSecure = 'ssl';
$mail->Host="smtp.zoho.com";
$mail->Port=465;
$mail->Username="contactowinpeed2@racingface.com";
$mail->Password="didczrlhpyjx";
$mail->SMTPDebug=1;
$mail->Helo = "winpeed.abdsystems.com"; //Muy importante para que llegue a hotmail y otros
$mail->AddAddress($destino);
$mail->IsHTML(true);
$mail->Subject="Autodromo Intl. Miguel E. Abed";
$mail->From="contactowinpeed2@racingface.com";
$mail->FromName= $from;
$mail->Timeout=30;
$mail->Body= $body;
$mail->AltBody = strip_tags($body);
$exito=$mail->Send();
return true;
} catch (phpmailerException $e){
echo $e->errorMessage(); //Pretty error messages from PHPMailer
} catch (Exception $e) {
echo $e->getMessage(); //Boring error messages from anything else!
}
}
}
?>
Mr.hm X_Shell Backd00r 1.0, Coded By Mr.hm X_Shell Backd00r