Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Wysyłania maila z hyperphp.com
Forum PHP.pl > Forum > PHP
kwiatek5
Witam,
próbuję wysłać maila z mojej domeny na hyperphp.com.
Nie są udostępnione adresy mailowe w darmowym hostingu.

Ustawiam w PHPMailerze dane mojego SMTP i wyskakuje błąd:

SMTP -> ERROR: Failed to connect to server: ()
SMTP Error: Could not connect to SMTP host.

Oczywiście PHPMailer jest skonfigurowany prawidłowo.
Czy jest możliwość wysłania maila z tego hostingu?

erix
Na pewno jest skonfigurowany? Pokaż ten kawałek, wycinając hasła i login, oczywiście.
kwiatek5
Cytat(erix @ 14.06.2011, 15:32:23 ) *
Na pewno jest skonfigurowany? Pokaż ten kawałek, wycinając hasła i login, oczywiście.


Zmieniłem dane w dołączonym przykładzie, więc musi być dobrze skonfigurowany.


  1. require_once('class.phpmailer.php');
  2.  
  3. $mail = new PHPMailer(true); // the true param means it will throw exceptions on errors, which we need to catch
  4.  
  5. $mail->IsSMTP(); // telling the class to use SMTP
  6.  
  7. try {
  8. $mail->Host = "smtp.poczta.onet.pl"; // SMTP server
  9. $mail->SMTPDebug = 2; // enables SMTP debug information (for testing)
  10. $mail->SMTPAuth = true; // enable SMTP authentication
  11. $mail->Port = 587; // set the SMTP port for the GMAIL server
  12. $mail->Username = "*******"; // SMTP account username
  13. $mail->Password = "*****"; // SMTP account password
  14. $mail->AddReplyTo('*****', 'First Last');
  15. $mail->AddAddress('*****', 'John Doe');
  16. $mail->SetFrom('*****', 'First Last');
  17. $mail->AddReplyTo('*****', 'First Last');
  18. $mail->Subject = 'PHPMailer Test Subject via mail(), advanced';
  19. $mail->AltBody = 'To view the message, please use an HTML compatible email viewer!'; // optional - MsgHTML will create an alternate automatically
  20. $mail->MsgHTML('ufcisuafcisduafcosid');
  21. $mail->Send();
  22. echo "Message Sent OK<p></p>\n";
  23. } catch (phpmailerException $e) {
  24. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  25. } catch (Exception $e) {
  26. echo $e->getMessage(); //Boring error messages from anything else!
  27. }
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.