Example #1
0
 function avisar($asunto, $notif)
 {
     //MANDAR UN EMAIL A LOS INTERESADOS
     $mail = new mosPHPMailer();
     // defaults to using php "mail()"
     $mail->IsSMTP();
     // telling the class to use SMTP
     $mail->FromName = "Pedro II";
     $mail->From = "*****@*****.**";
     $mail->Username = "******";
     $mail->Password = "******";
     $mail->Port = 465;
     $mail->IsHTML(true);
     $mail->SMTPAuth = true;
     $mail->SMTPSecure = "ssl";
     $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
     // optional, comment out and test
     $mail->CharSet = "ISO-8859-1";
     //$mail->MsgHTML($body);
     $mail->ClearAllRecipients();
     $mail->Subject = $asunto;
     $body = $notif;
     $mail->Body = $body;
     $mail->Mailer = 'smtp';
     # destinatarios
     $mail->AddAddress('*****@*****.**');
     $mail->AddAddress('*****@*****.**');
     $ret5 = $mail->Send();
     if (!$ret5) {
         $errorMail = "Error al enviar email<br>" . $mail->ErrorInfo . '<br />' . $mail->Host . '<br />' . $mail->From . '<br />' . $mail->Username . '<br />' . $mail->Password . '<br />';
         echo $errorMail;
         return false;
     }
     return true;
 }