Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem z wysyłaniem maili PHPMailer
pietroff
post 5.06.2020, 11:35:01
Post #1





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 11.03.2013

Ostrzeżenie: (0%)
-----


Witam

mam problem z wysyłaniem maili za pomocą PHPMailer poniżej kod. Czy możecie wskazać mi błąd? Bo już ręce opadają, ciągle dostaję odpowiedź:
"Message was not sent.Mailer error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki...eshooting"

  1. function send_mail($email,$message,$subject)
  2. {
  3. require_once('mailer/class.phpmailer.php'); //dodanie klasy phpmailer
  4. require_once('mailer/class.smtp.php'); //dodanie klasy smtp
  5. $mail = new PHPMailer();
  6. $mail->IsSMTP(); // telling the class to use SMTP
  7. $mail->Host = "poczta.o2.pl"; // specify main and backup server
  8. $mail->Port = 587;
  9. $mail->SMTPAuth = true; // turn on SMTP authentication
  10. $mail->Username = 'adres@tlen.pl'; //SMTP username
  11. $mail->Password = '**********'; // SMTP password
  12. $mail->From = 'adres@tlen.pl';
  13. $mail->AddAddress($email);
  14.  
  15. $mail->Subject = $subject;
  16. $mail->Body = $message;
  17. $mail->WordWrap = 50;
  18.  
  19. if(!$mail->Send()){
  20. echo 'Message was not sent.';
  21. echo 'Mailer error: ' . $mail->ErrorInfo;
  22. }
  23. else{
  24. echo 'Message has been sent.';
  25. }
  26. }
  27.  
Go to the top of the page
+Quote Post
trueblue
post 5.06.2020, 11:37:07
Post #2





Grupa: Zarejestrowani
Postów: 6 761
Pomógł: 1822
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


A może warto zajrzeć do źródła?
https://pomoc.o2.pl/jak-skonfigurowac-program-pocztowy


--------------------
Go to the top of the page
+Quote Post
pietroff
post 5.06.2020, 11:41:57
Post #3





Grupa: Zarejestrowani
Postów: 22
Pomógł: 0
Dołączył: 11.03.2013

Ostrzeżenie: (0%)
-----


ok po zmianie portu na 465 otrzymuje komunikat:

Message was not sent.Mailer error: Could not instantiate mail function.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 23.04.2024 - 19:16