Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP] Nie wysyła wiadomości na maila
Vadd
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2011
Skąd: Dąbrowa Górnicza

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


Mam taki kod php zmienne są pobierane z flasha.
  1. <?
  2. if(!empty($HTTP_POST_VARS['sender_email']) || !empty($HTTP_POST_VARS['sender_tresc']) || !empty($HTTP_POST_VARS['sender_imie']) || !empty($HTTP_POST_VARS['sender_nazwisko']) || !empty(HTTP_POST_VARS['sender_telefon']))
  3. {
  4. $to = "mail@mail.cpl";
  5. $subject = stripslashes($HTTP_POST_VARS['sender_imie']);
  6. $body = stripslashes($HTTP_POST_VARS['sender_tresc']);
  7. $body .= "\n\n---------------------------\n";
  8. $body .= "email sent by: " . $HTTP_POST_VARS['sender_imie'] . " <" . $HTTP_POST_VARS['sender_email'] . ">\n";
  9. $header = "From: " . $HTTP_POST_VARS['sender_imie'] . " <" . $HTTP_POST_VARS['sender_email'] . ">\n";
  10. $header .= "Reply-To: " . $HTTP_POST_VARS['sender_imie'] . " <" . $HTTP_POST_VARS['sender_email'] . ">\n";
  11. $header .= "X-emailer: PHP/" . phpversion() . "\n";
  12. $header .= "X-Priority: 1";
  13. if(@mail($to, $subject, $body, $header))
  14. {
  15. echo "output=sent";
  16. } else {
  17. echo "output=error";
  18. }
  19. } else {
  20. echo "output=error";
  21. }
  22. ?>


Lecz niestety nie wysyła maila sad.gif

Czemu ?

Dziękuję za odpowiedź.

Ten post edytował Vadd 7.06.2011, 15:33:47
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 6)
mat-bi
post
Post #2





Grupa: Zarejestrowani
Postów: 690
Pomógł: 92
Dołączył: 6.02.2011

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


$HTTP_POST_VARS [deprecated]
Go to the top of the page
+Quote Post
Vadd
post
Post #3





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2011
Skąd: Dąbrowa Górnicza

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


Mogę prosić o coś więcej ?
Go to the top of the page
+Quote Post
mat-bi
post
Post #4





Grupa: Zarejestrowani
Postów: 690
Pomógł: 92
Dołączył: 6.02.2011

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


http://www.php.net/manual/pl/reserved.variables.post.php
Go to the top of the page
+Quote Post
Vadd
post
Post #5





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2011
Skąd: Dąbrowa Górnicza

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


Niestety zmieniłem już to z czego podałeś link i dalej nie działa z tym że teraz na maila dostaję taka wiadomość:
CODE
undefined

---------------------------
Mail sent by: undefined <>
undefined


Teraz cały kod wygląda tak:
Kod
<?
if(!empty($_POST['sender_imie']) || !empty($_POST['sender_nazwisko']) || !empty($_POST['sender_telefon']))
{
    $to = "mail@test.pl";
    $subject = stripslashes($_POST['sender_imie']);
    $body = stripslashes($_POST['sender_tresc']);
    $body .= "\n\n---------------------------\n";
    $body .= "Mail sent by: " . $_POST['sender_imie'] . " <" . $_POST['sender_mail']  . ">\n";
    $body .= "" . $_POST['sender_tresc'] . "";
    $header = "From: " . $_POST['sender_name'] . " <" . $_POST['sender_mail'] . ">\n";
    $header .= "Reply-To: " . $_POST['sender_name'] . " <" . $_POST['sender_mail'] . ">\n";
    $header .= "X-Mailer: PHP/" . phpversion() . "\n";
    $header .= "X-Priority: 1";
    if(@mail($to, $subject, $body, $header))
    {
        echo "output=sent";
    } else {
        echo "output=error";
    }
} else {
    echo "output=error";
}
?>


Ten post edytował Vadd 7.06.2011, 17:51:53
Go to the top of the page
+Quote Post
modern-web
post
Post #6





Grupa: Zarejestrowani
Postów: 763
Pomógł: 117
Dołączył: 15.03.2010
Skąd: void

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


Wywal może operator tlumienia błędów - @ - przed funkcja "mail". Zobacz czy wyskoczy jakis komunikat..


--------------------
Pomogłem? Kliknij `Pomógł`. To nic nie kosztuje, a mnie usatysfakcjonuje! ;)
Go to the top of the page
+Quote Post
Vadd
post
Post #7





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 24.04.2011
Skąd: Dąbrowa Górnicza

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


Już sobie poradziłem..

Proszę o zamknięcie..
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: 19.08.2025 - 09:18