Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Nadawca z formularza w phpMailer
adamantd
post
Post #1





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


Witam! Mam problem z $mail->From = 'nadawca@asd.pl';

jeżeli wpiszę tak jak jest w powyższym przykładzie to wszystko działa. Maile docierają a w polu Od: widnieje mail, który wpisałem na sztywno w stringu powyżej.
jeżeli jednak zapiszę go do zmiennej np: $nadawca, i tą zmienną przypiszę do $mail->From to nie wysyłają się maile.

Przy czym $mail->send(); zwraca true ale nigdzie one nie docierają. Sprawdzałem bezpośrednio przed utworzeniem obiektu new phpMailer(); i w zmiennej $nadawca znajduje się adres e-mail. Starałem sie go czyścić na wszelki wypadek stripslashes i trim a oprócz tego wywaliłem wszystko co go wcześniej waliduje w ramach testu i nic nie pomaga.

Dla pewności, wymusiłem na nim że ma być stringiem (string)$nadawca choć i tak nim był i nie pomaga...

Co może być powodem?
Go to the top of the page
+Quote Post
2 Stron V   1 2 >  
Start new topic
Odpowiedzi (1 - 19)
Konochamaru
post
Post #2





Grupa: Zarejestrowani
Postów: 11
Pomógł: 0
Dołączył: 26.02.2013

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


Mógł Bys wkleić kod ?
Go to the top of the page
+Quote Post
adamantd
post
Post #3





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


fragment klasy wykorzystującej phpMailer

wszystkie parametry są przypisane do właściwości klasy a wartości takie jak tekst, tytuł, mail nadawcy umieszczam jako parametry tworząc obiekt
i tak jak pisałem wszystko działa jeżeli na sztywno wpiszę jakiś adres e-mail


  1.  
  2. $mailNada = 'jakis@mail.pl';
  3.  
  4. $mail = new phpMailer();
  5. $mail->PluginDir = $this->folderPhpMailer;
  6. $mail->From = $mailNada;////////////////////////// TAK JAK JEST TERAZ NIE CHCE WYSYŁAĆ WIADOMOŚCI
  7. $mail->CharSet = "ISO-8859-2";
  8. $mail->FromName = $titFrom;
  9. $mail->Host = $this->hostSmtp;//host
  10. $mail->Mailer = "smtp";
  11. $mail->Username = $this->mailPost;//poczta dzięki której wysyłana jest wiadomość
  12. $mail->Password = $this->mailPass;
  13. $mail->SMTPAuth = true;
  14. $mail->SetLanguage($this->language, $this->folderPhpMailer.'language/');
  15. $mail->Subject = $title;
  16. $mail->Body = $text;
  17. $mail->AddAddress($mailOdb, $titTo);
  18. $si = $mail->Send();
  19.  
  20. $mail->ClearAddresses();
  21. $mail->ClearAttachments();
  22.  
  23.  
  24. //jeżeli wpiszę na sztywno jakikolwiek adres to wysyła i prezentuje go w polu Od:
  25. $mail->From = 'jakis@adres.pl';
  26.  



edti:


sorki mała poprawka -jeżeli przed samym utworzeniem obiektu przypiszę do zmiennej $nadawca adres e-mail to wszystko gra...... ale jak sprawdzam dane zebrane z formularza to znajduje się tam e-mail przed samym utworzeniem obiektu a mimo wszystko nie wysyła maila

Ten post edytował adamantd 28.03.2013, 14:01:52
Go to the top of the page
+Quote Post
nospor
post
Post #4





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




1) Jesteś pewien, ze pokazałeś nam dokładnie kod jaki masz??
2) Czy zastosowałeś się porad w temacie, który już ci podawałem
Temat: Jak poprawnie zada pytanie
?
Go to the top of the page
+Quote Post
adamantd
post
Post #5





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


Zaraz wszystko posprawdzam dokładnie i przyglądne się temu razem z wyświetlaniem błędów i jeśli są to je przedstawię

zakomentowałem header przerzucający na stronę z infem o udanym wysłaniu wiadomości i użyłem:
  1.  
  2. ini_set('display_errors','1');
  3.  


standardowo pokazało jakieś pierdoły "notice:" nie związane z tematem ale błędów nie ma żadnych przy udanym wysłaniu wiadomości która nie dociera do mnie na skrzynkę

zrobiłem też test zmiennej w której znajduje się adres e-mail

  1.  
  2. mail: test@onet.pl
  3. gettype: string
  4. <pre>: test@onet.pl
  5. htmlspecialchars: test@onet.pl
  6.  





Jeśli chodzi o sam obiekt $mail to przedstawiłem wszystko, nie przedstawiałem całej klasy którą utworzyłem żeby używać classy phpMailer bo chyba nie ma potrzeby
Go to the top of the page
+Quote Post
nospor
post
Post #6





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
standardowo pokazało jakieś pierdoły "notice:" nie związane z tematem
A skad wiesz ze nie związane? Patrzac w na twoje tematy mogę podejrzewać, że jednak sie mylisz....

Pokaż cały kod, bo widać ze dane pobierasz z forma, a nie z palca do zmiennej jak nam pokazałes.
Pokaż też wszystkie błędy jakie dostajesz, nawet jesli to NOTICE "nie związany z tematem"....
Go to the top of the page
+Quote Post
adamantd
post
Post #7





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


chwilke mnie nie było

to wszystkie notice po wysąniu wiadomości, którą udaje się wysłąć ale nie dociera bez headera przerzucającego na inną stronę po wysłaniu wiadomości

  1.  
  2. Notice: A session had already been started - ignoring session_start() in /home/users/xxxxxxxx/public_html/scripts/get_link.php on line 2
  3.  
  4. Notice: Use of undefined constant xxxxxxx- assumed 'xxxxxxxxxxx' in /home/users/xxxxxxxxxxx/public_html/scripts/define_scr.php on line 4
  5.  
  6. Notice: Use of undefined constant xxxxxxxxx- assumed 'xxxxxxxxxxx' in /home/users/xxxxxxxxxx/public_html/scripts/define_scr.php on line 5
  7.  
  8. Notice: Use of undefined constant xxxxxxxxx- assumed 'xxxxxxxxxx' in /home/users/xxxxxxxxxxx/public_html/scripts/define_scr.php on line 6
  9.  
  10. Notice: Use of undefined constant xxxxxxxxx- assumed 'xxxxxxxxxx' in /home/users/xxxxxxxxxxxx/public_html/scripts/define_scr.php on line 7
  11.  
  12. Notice: Use of undefined constant xxxxxxxxxxxx- assumed 'xxxxxxxxxxx' in /home/users/xxxxxxxxxxxx/public_html/scripts/define_scr.php on line 9
  13.  
  14. Notice: Use of undefined constant xxxxxxxxxxx- assumed 'xxxxxxxxx' in /home/users/xxxxxxxxxxxx/public_html/scripts/define_scr.php on line 16
  15.  
  16. Notice: Use of undefined constant xxxxxxxxx- assumed 'xxxxxxxxxx' in /home/users/xxxxxxxxxxxx/public_html/scripts/define_scr.php on line 17
  17.  
  18. Notice: Use of undefined constant xxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 18
  19.  
  20. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 19
  21.  
  22. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 20
  23.  
  24. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 21
  25.  
  26. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 22
  27.  
  28. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 23
  29.  
  30. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 24
  31.  
  32. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 25
  33.  
  34. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 29
  35.  
  36. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 30
  37.  
  38. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 31
  39.  
  40. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 32
  41.  
  42. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 33
  43.  
  44. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 34
  45.  
  46. Notice: Use of undefined constant xxxxxxxxxxxxxxxx - assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 35
  47.  
  48. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 36
  49.  
  50. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 37
  51.  
  52. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 38
  53.  
  54. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 39
  55.  
  56. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 40
  57.  
  58. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 41
  59.  
  60. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 42
  61.  
  62. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 43
  63.  
  64. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 44
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  


trochę ją zaiksowałem (IMG:style_emoticons/default/wink.gif)

a to reszta bo nie udało się w jednej wiadomości


  1.  
  2. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 45
  3.  
  4. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 46
  5.  
  6. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 47
  7.  
  8. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 48
  9.  
  10. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 49
  11.  
  12. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 50
  13.  
  14. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 51
  15.  
  16. Notice: Use of undefined constant xxxxxxxxxxxxxxxx - assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 52
  17.  
  18. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 53
  19.  
  20. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 54
  21.  
  22. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 55
  23.  
  24. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 56
  25.  
  26. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 57
  27.  
  28. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 58
  29.  
  30. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 59
  31.  
  32. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 60
  33.  
  34. Notice: Use of undefined constant xxxxxxxxxxxxxxxx- assumed 'xxxxxxxxxxxxxxxx' in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/define_scr.php on line 61
  35.  
  36. Notice: A session had already been started - ignoring session_start() in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/kontakt_scr.php on line 2
  37.  
  38. Notice: A session had already been started - ignoring session_start() in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/Captcha/Captcha.class.php on line 2
  39.  
  40. Notice: Undefined index: mail_log in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/kontakt_scr.php on line 34
  41.  
  42. Notice: Undefined index: mail_log in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/kontakt_scr.php on line 42
  43.  
  44. Notice: Undefined variable: blad in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/kontakt_scr.php on line 44
  45.  
  46. Notice: Undefined variable: capCode in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/Captcha/Captcha.class.php on line 49
  47.  
  48. Notice: Undefined index: mail_log in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/body.class.php on line 383
  49.  
  50. Notice: Undefined variable: classMyNeutral in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/body.class.php on line 407
  51.  
  52. Notice: Undefined variable: nickMyKont in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/body.class.php on line 407
  53.  
  54. Notice: Undefined variable: classMyOks in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/body.class.php on line 409
  55.  
  56. Notice: Undefined variable: mailMyKont in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/body.class.php on line 409
  57.  
  58. Notice: Undefined index: weryfikacja in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/get_link.php on line 375
  59.  
  60. Notice: A session had already been started - ignoring session_start() in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/licznik_odw.php on line 2
  61.  
  62. Notice: Undefined index: mail_log in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 126
  63.  
  64. Notice: Undefined index: avatar_name in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 155
  65.  
  66. Notice: Undefined index: nick in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 157
  67.  
  68. Notice: Undefined variable: imgWiadOdbr in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 158
  69.  
  70. Notice: Undefined variable: countMess in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 158
  71.  
  72. Notice: Undefined index: date_show_propo in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 239
  73.  
  74. Notice: Undefined variable: resAraDatepick in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 260
  75.  
  76. Notice: Undefined index: mail_log in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 285
  77.  
  78. Notice: A session had already been started - ignoring session_start() in /home/users/xxxxxxxxxxxxxxxx/public_html/scripts/rejestracja_scr.php on line 2
  79.  
  80. Notice: Undefined variable: style_hardcore in /home/users/xxxxxxxxxxxxxxxx/public_html/CLASS/MODULS/szablon.class.php on line 386
  81.  
  82.  
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Prosiłem jeszcze o kod, w którym przypisujesz dane z forma do maila. Czemu Tobie trzeba wszystko pięć razy powtarzać?

I pomysl, po co mi wyxowane komunikaty.... Przecież z nich nic nie jestem w stanie wyciągnąc o błędzie....
Go to the top of the page
+Quote Post
adamantd
post
Post #9





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


  1.  
  2. <?php
  3.  
  4.  
  5.  
  6. if(isset($_POST['buttKont'])){
  7.  
  8. require_once('CLASS/Captcha/Captcha.class.php');
  9.  
  10. $nickKont = strip_tags(trim($_POST['nickKont']));
  11. $nickHiddKont = strip_tags(trim($_POST['nickHiddKont']));//pole hidden
  12. $mailKont = strip_tags(trim($_POST['mailKont']));
  13. $tematKont = strip_tags(trim($_POST['tematKont']));
  14. $mailKontFunny = strip_tags(trim($_POST['mailKontFunny']));
  15. $treKont = strip_tags(trim($_POST['treKont']));
  16. $captchaKontSpr = strip_tags(trim($_POST['captcha_text_oglo']));
  17.  
  18. $checking = new checkForms;
  19. if($nickKont!=''){
  20. if(!$checking->checkNick($nickKont)){ $blad++;} else {
  21. if(!$checking->checkString($nickKont, 3, 50)) { $blad++;}
  22. }
  23. }
  24. if(!$checking->checkMail($mailKont)) { $blad++;}
  25. if(!is_numeric($tematKont)){$blad++;}
  26. if($mailKontFunny!=''){$blad++;}
  27. if(!$checking->checkString($treKont, 1, 2050)){$blad++;}
  28.  
  29. $checkCap = new Captcha;
  30. $checkCap->porownanie($captchaKontSpr);
  31. if($checkCap->wynik==0) { $blad++;}
  32.  
  33. $arrTemat = array(1=>'Ogólnie', 'Zgłoszenie błędów funkcjonalności', 'Sugestie poprawy funkcjonalności', 'Zgłoszenie niestosownej treści');
  34. if($_SESSION['mail_log'] && $_SESSION['logged']==true){//jeśli zalogowany to z sesji a jeśli nie to wpisany (jeśłi podano nicka oczywiście)
  35. $wpisSessNick = 'z sesji';
  36. } else {
  37. $wpisSessNick = 'wpisany';
  38. $nickHiddKont = $nickKont;
  39. }
  40.  
  41. $howNick = $nickHiddKont!=''?'NICK ('.$wpisSessNick.'): '.$nickHiddKont:'BRAK NICKA';//jeśli podano nick
  42. if($_SESSION['mail_log'] && $_SESSION['logged'] == true){ $infoControl = ' przez usera nick: [ '.$_SESSION['nick'].' ] mail: [ '.$_SESSION['mail_log'].' ]'; } else { $infoControl = false; }
  43.  
  44. if($blad==0){
  45. $newMail = new sendMailTo;
  46. $si = $newMail->mailParam($arrTemat[$tematKont], $treKont, $mailKont, $howNick);
  47. if($si){
  48. userManagPlus::addCountKontaktUsers();
  49. header('Location: WiadomoscWyslano');
  50. } else {
  51. AddLogens::NewLog("Problem z wysłaniem wiadomości (technicznie wina phpmailera) w zakładce kontakt".$infoControl, __LINE__, __FILE__);
  52. header('Location: WiadomoscError');
  53. }
  54.  
  55. } else {
  56. AddLogens::NewLog("Problem z wysłaniem wiadomości (błąd przy walidacji) w zakładce kontakt".$infoControl, __LINE__, __FILE__);
  57. die('PROBLEM PODCZAS WYSYŁANIA WIADOMOŚCI -ZOSTANIE ON ZGŁOSZONY ADMINISTRATOROWI');
  58. }
  59.  
  60. }//end if is post
  61.  
  62.  


wybacz ale robiłem 5 rzeczy na raz łącznie z obiadem

to kod w którym zbieram sprawdzam dane i tworzę obiekt mojej klasy z phpmailerem po tym jak przejdą po stronie usera
Go to the top of the page
+Quote Post
nospor
post
Post #10





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Nie widzę jeszcze kodu, gdzie przypisujesz coś do FROM w mailu....

ps: jak twoja aplikacja sypie tyloma błędami, to masz ją strasznie źle napisaną..... z czasem nie ogarniesz tego, nie dasz rady. Przy najmniejszym błędzie będziesz siedział godzinami i go szukał...
Go to the top of the page
+Quote Post
adamantd
post
Post #11





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


  1.  
  2. class sendMailTo {
  3.  
  4. protected $folderPhpMailer = 'CLASS/phpmailer/';
  5. protected $language = 'pl';
  6. protected $hostSmtp = 'xxxxxxxx.pl';
  7. protected $mailPost = 'postmaster@xxxxxx.pl';
  8. protected $mailPass = 'xxxxxxxxxxxx';
  9. protected $mailAdmin = 'admin@xxxxxxxxxxxx.pl';
  10. protected $nameSerwis = 'www.xxxxxxxxxx.pl';
  11.  
  12. public function __construct($mailPost=false, $mailPass=false){
  13. if($mailPost!=false && $mailPass!=false){
  14. $this->mailPost=$mailPost;
  15. $this->mailPass=$mailPass;
  16. $this->mailAdmin=$mailPost;
  17. }
  18. }//end method __construct
  19.  
  20. public function mailParam($title, $text, $mailNada, $titTo, $mailOdb=false){
  21. if($mailNada=='1'){
  22. $mailNada=$this->mailPost;
  23. $titFrom=$this->nameSerwis.' Wiadomość wygenerowana automatycznie ';
  24. $titTo='Do Użytkownika: '.$titTo;
  25. } else if($mailNada=='2'){
  26.  
  27. $mailNada=$this->mailAdmin;
  28. $titFrom=$this->nameSerwis.' Administrator Serwisu ';
  29. $titTo='Do Użytkownika: '.$titTo;
  30. } else {
  31. $mailOdb=$this->mailAdmin;
  32. $titFrom='Użytkownik: '.$titTo.' ';
  33. $titTo='::: Do Administratora strony: '.$this->nameSerwis;
  34. }
  35. include_once($this->folderPhpMailer.'class.phpmailer.php');
  36.  
  37. $mail = new phpMailer();
  38. $mail->PluginDir = $this->folderPhpMailer;
  39. $mail->CharSet = "ISO-8859-2";
  40. $mail->From = $mailNada;
  41. $mail->FromName = $titFrom;
  42. $mail->Host = $this->hostSmtp;
  43. $mail->Mailer = "smtp"; //smtp
  44. $mail->Username = $this->mailPost;
  45. $mail->Password = $this->mailPass;
  46. $mail->SMTPAuth = true;
  47. $mail->SetLanguage($this->language, $this->folderPhpMailer.'language/');
  48. $mail->Subject = $title;
  49. $mail->Body = $text;
  50. $mail->AddAddress($mailOdb, $titTo);
  51. $si = $mail->Send();
  52.  
  53. $mail->ClearAddresses();
  54. $mail->ClearAttachments();
  55.  
  56. if($si){
  57. return true;
  58. } else {
  59. return false;
  60. }
  61.  
  62. }//end mailParam method
  63.  
  64. }//end class sendMailTo



zdaję sobie sprawę z tego co mówisz mistrzu ale ja się uczyłem na tej aplikacji php -sam nie jestem jeszcze mistrzem, więc popełniam sporo błędów, wierzę, że z czasem coraz mniej
Go to the top of the page
+Quote Post
nospor
post
Post #12





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Przy tej linii:
$mail->From = $mailNada;
zrób
var_dump($mailNada);
$mail->From = $mailNada;

Cytat
ale ja się uczyłem na tej aplikacji php -sam nie jestem jeszcze mistrzem, więc popełniam sporo błędów, wierzę, że z czasem coraz mniej
Wybacz ale nie rozumiem jaki masz problem by używać isset zanim dobierzesz się do indeksu którego nie ma.
Go to the top of the page
+Quote Post
adamantd
post
Post #13





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


wyświetliło się:

string(10) "test@wp.pl"
Go to the top of the page
+Quote Post
nospor
post
Post #14





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




I twierdzisz, że jak z palca tę wartość wpiszesz, zamiast zmiennej, to ci maila dochodzą?
Go to the top of the page
+Quote Post
adamantd
post
Post #15





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


Dokładnie tak (IMG:style_emoticons/default/smile.gif)

jest to dla mnie dziwne -minutę temu zrobiłem test dla pewności, wpisałem z palca

  1. $mail->From = 'asd@asd.pl';


i doszedł mi mail na outlocka hehe kompletnie nie rozumiem dlaczego.
Co lepsze jeżeli zrobię to tak:

  1.  
  2. $przyklad = 'asd@asd.pl';
  3. $mail->From = $przyklad;
  4.  
  5.  


to mail również dochodzi na outlocka a w polu Od: widnieje mail asd@asd.pl
Go to the top of the page
+Quote Post
nospor
post
Post #16





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Nie mówimy teraz o żadnym asd..... tylko o konkretnym mailu ktory masz w zmiennej a mianowicie: test@wp.pl

Pytam ponownie. Sugerujesz, ze o to:
$mail->From = 'test@wp.pl';
Ci działa

ale już to,
$mail->From = $mailNada;
gdzie $mailNada równa się dokładnie test@wp.pl
już ci nie działa?

Niemożliwe (IMG:style_emoticons/default/smile.gif) Przypominam, mówimy cały czas o wartosci test@wp.pl a nie żadnym asd...
Go to the top of the page
+Quote Post
adamantd
post
Post #17





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


chwila zrobię jeszcze ze dwa bardzo dokładne testy
Go to the top of the page
+Quote Post
nospor
post
Post #18





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Cytat
doszedł mi mail na outlocka
Poza tym, maili nie są wysyłane do zadnego outlocka, tylko na skrzynkę pocztową. Sprawdzaj bezpośrednio w niej, bo moze outlook ci poprostu filtruje jakoś wiadomosci....
Go to the top of the page
+Quote Post
adamantd
post
Post #19





Grupa: Zarejestrowani
Postów: 228
Pomógł: 7
Dołączył: 15.08.2012
Skąd: Rzeszów

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


Już wszystko wiem (IMG:style_emoticons/default/smile.gif)

Po kilkunastu testach:

  1.  
  2. $mail->From = 'test@wp.pl';
  3. //nie dociera do mnie wiadomość
  4.  
  5. $mail->From = 'asd@asd.pl';
  6. //wiadomość dociera
  7.  
  8. $mail->From = $mailNada;
  9. //jeżeli w formularzu jest mail: asd@asd.pl -dociera, jeżeli jest wp, onet, interia (sprawdziłem te trzy) -mail nie dociera
  10. //wyłączyłem outlocka i wszedłem bezpośrednio na skrzynkę (mam na wp)
  11. //z tych trzech wynienionych adresów wp, onet, interia nie dociera nic
  12. //zarówno z palca w skrypcie jak i wpisane w formularzu asd@asd.pl dociera a skrzynkę i na outlocka
  13.  
  14.  
Go to the top of the page
+Quote Post
nospor
post
Post #20





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




I naprawde trzeba było aż tylu postów by do tego dojsc? Przecież do tego wniosku powinieneś był sam dojść w dwie minuty bez zakładania tematu na forum.... Spadam, na dziś mam dość takich tematów (IMG:style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

2 Stron V   1 2 >
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: 22.08.2025 - 12:27