Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- warning: mail() [function mail]: SMTP server response: 550.5.7.1 <email@gmail.com>... Relaying denied. IP name possibly forged [191...] in line 100
- mail($destinatario,$asunto,$body);
- $sql = "select EMAIL1_CLI from planilla_imbra_cobranza";
- $rpt = mysqli_query($sub_db,$sql)or die(mysqli_error());
- //$asunto = 'Aviso de Deuda';
- $mail = new PHPMailer(); // defaults to using php "mail()"
- $body = "Este es un mensaje automatico...";
- $mail->From = "no-responder@xx.cl";
- $mail->FromName = "Francisco Acevedo Diaz";
- $mail->AddAddress('francisco@gmail.com','Clientes'); //deb poner variable que traiga mail y nombre del cliente
- $mail->SetFrom('cobranza@xx.cl', 'Depto. Cobranza');
- $asunto = $mail->Subject = 'Aviso de deuda en oriental Motors';
- $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
- $mail->MsgHTML($body);
- $mail->IsSMTP();
- $mail->Host = "mail.xx.cl";
- // optional
- // used only when SMTP requires authentication
- $mail->SMTPAuth = true;
- $mail->Username = 'xx';
- $mail->Password = 'xx';
- while ($des = mysqli_fetch_array($rpt)) {
- $destinatario = $des["EMAIL1_CLI"];
- printf ($destinatario);
- //$mail->AddAddress = $des['EMAIL1_CLI'];
- //$mail->AddAddress("facevedo@xx.cl");
- mail($destinatario,$asunto,$body);
- }
- if(!$mail->Send()) {
- echo "Mailer Error: " . $mail->ErrorInfo;
- exit;
- } else {
- echo "Message sent!";
- }
- }
Add Comment
Please, Sign In to add comment