Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP]Serwer home lub nazwa ustawiniea smtp w swiftmailer
borpaw
post
Post #1





Grupa: Zarejestrowani
Postów: 439
Pomógł: 0
Dołączył: 3.06.2010

Ostrzeżenie: (50%)
XXX--


Witam

czy ktoś może walczył z wysyłaniem email przez serwer smtp na home.pl lub nazwa.pl?

Używam php swiftmailer'a, poniżej adresy wpisałem fikcyjne. Na prawdziwych adresach dostaje komunikat:

  1. Uncaught exception 'Swift_TransportException' with message 'Expected response code 354 but got code "530", with message "530 5.7.0 No auth during mail transaction


Tyle, że konto którego używam istnieje i działa np: na outlook, jeśli w ten skrypt wpisze np server onetu wszystko jest ok, także skrypt też jest dobry tyle że nie na home.pl

  1. require_once 'vendor/swiftmailer/swiftmailer/lib/swift_required.php';
  2.  
  3. $transport = Swift_SmtpTransport::newInstance('smtp.home.pl', 587, 'tls')
  4. ->setUsername('test@test.pl')
  5. ->setPassword('*****')
  6. ->setAuthMode('login');
  7.  
  8. try {
  9. $mailer = Swift_Mailer::newInstance($transport);
  10. } catch (Swift_TransportException $exception) {
  11. var_dump($exception);
  12. }
  13.  
  14. $message = Swift_Message::newInstance()
  15. ->setSubject('Albo tak' . time())
  16. ->setFrom(array('test@test.pl' => 'Spotkanie firmowe' . time()))
  17. ->setTo(array('jakisadres@onet.pl'))
  18. ->setBody('jakas tresc')
  19. ;
  20.  
  21. echo "<br>";
  22.  
  23. if ($recipients = $mailer->send($message, $failures)) {
  24. print_r($failures);
  25. echo 'Message successfully sent!';
  26. } else {
  27. echo "There was an error:\n";
  28. print_r($failures);
  29. }
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 24.08.2025 - 04:03