Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] PHPMailer
peter13135
post
Post #1





Grupa: Zarejestrowani
Postów: 1 447
Pomógł: 191
Dołączył: 26.03.2008

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


Korzystam z tego przykładu :

http://phpmailer.worxware.com/index.php?pg=examplebmail

Chcę wysłać maila, lecz mam taki error:

Kod
Call to undefined method phpmailer::MsgHTML()


Wchodzę do pliku źródłowego no i faktycznie takiej metody nie ma. Poza tym, plik zdaje się być stary, widać tam np. "var" przed zmiennymi w klasie, zamiast public/private/protected.
Wersja jaką ściągałem była oznaczona php5/6

wchodzę tutaj : http://phpmailer.worxware.com/index.php?pg=methods, by zobaczyć metody... no i ta metoda istnieje, ale w moim pliku jej nie ma. O co tutaj chodzi ?


--------------------
:)
Go to the top of the page
+Quote Post
vokiel
post
Post #2





Grupa: Zarejestrowani
Postów: 2 592
Pomógł: 445
Dołączył: 12.03.2007

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


Pokaż kod, ja korzystałem z PHPMailera i nigdy nie miałem takich problemów


--------------------
Go to the top of the page
+Quote Post
peter13135
post
Post #3





Grupa: Zarejestrowani
Postów: 1 447
Pomógł: 191
Dołączył: 26.03.2008

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


  1. private function sendMessage()
  2. {
  3. try
  4. {
  5. $phpmailer = new PHPMailer(true);
  6. $phpmailer->AddReplyTo($this->conf->get('email'), 'Administrator');
  7. $phpmailer->Subject = $_POST['title'];
  8. $phpmailer->MsgHTML($_POST['message']);
  9.  
  10. $users = $this->getUsers($_POST['newsletter_group']);
  11. foreach ($users as $user) //odbiorcy
  12. {
  13. $phpmailer->AddAddress($user['email'], $user['name'] . ' ' . $user['surname']);
  14. }
  15. $files = $this->getFiles();
  16. foreach ($files as $file)
  17. {
  18. $phpmailer->AddAttachment('tmp/' . $file); // dodaje załączniki
  19. }
  20. $phpmailer->Send();
  21. }
  22. catch (phpmailerException $e)
  23. {
  24. echo $e->errorMessage(); //Pretty error messages from PHPMailer
  25. }
  26. catch (exception $e)
  27. {
  28. echo $e->getMessage(); //Boring error messages from anything else!
  29. }
  30.  
  31. }


--------------------
:)
Go to the top of the page
+Quote Post
vokiel
post
Post #4





Grupa: Zarejestrowani
Postów: 2 592
Pomógł: 445
Dołączył: 12.03.2007

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


Coś te źródła u nich na stronie są wybrakowane, zobacz tu: https://code.google.com/a/apache-extras.org/p/phpmailer/


--------------------
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 Aktualny czas: 21.08.2025 - 19:42