Guest User

Untitled

a guest
Sep 15th, 2018
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. warning: mail() [function mail]: SMTP server response: 550.5.7.1 <email@gmail.com>... Relaying denied. IP name possibly forged [191...] in line 100
  2.  
  3. mail($destinatario,$asunto,$body);
  4.  
  5. $sql = "select EMAIL1_CLI from planilla_imbra_cobranza";
  6.  
  7. $rpt = mysqli_query($sub_db,$sql)or die(mysqli_error());
  8. //$asunto = 'Aviso de Deuda';
  9.  
  10. $mail = new PHPMailer(); // defaults to using php "mail()"
  11. $body = "Este es un mensaje automatico...";
  12.  
  13.  
  14. $mail->From = "no-responder@xx.cl";
  15. $mail->FromName = "Francisco Acevedo Diaz";
  16.  
  17.  
  18.  
  19. $mail->AddAddress('francisco@gmail.com','Clientes'); //deb poner variable que traiga mail y nombre del cliente
  20. $mail->SetFrom('cobranza@xx.cl', 'Depto. Cobranza');
  21.  
  22.  
  23.  
  24. $asunto = $mail->Subject = 'Aviso de deuda en oriental Motors';
  25.  
  26.  
  27. $mail->AltBody = "To view the message, please use an HTML compatible email viewer!";
  28. $mail->MsgHTML($body);
  29.  
  30.  
  31.  
  32. $mail->IsSMTP();
  33. $mail->Host = "mail.xx.cl";
  34.  
  35.  
  36. // optional
  37. // used only when SMTP requires authentication
  38. $mail->SMTPAuth = true;
  39. $mail->Username = 'xx';
  40. $mail->Password = 'xx';
  41.  
  42.  
  43. while ($des = mysqli_fetch_array($rpt)) {
  44. $destinatario = $des["EMAIL1_CLI"];
  45. printf ($destinatario);
  46.  
  47. //$mail->AddAddress = $des['EMAIL1_CLI'];
  48. //$mail->AddAddress("facevedo@xx.cl");
  49. mail($destinatario,$asunto,$body);
  50.  
  51. }
  52.  
  53. if(!$mail->Send()) {
  54. echo "Mailer Error: " . $mail->ErrorInfo;
  55. exit;
  56. } else {
  57. echo "Message sent!";
  58. }
  59. }
Add Comment
Please, Sign In to add comment