Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] - Problem z treścią maila (send.php)
pawelalfa
post
Post #1





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

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


Cześć witam, mam problem z treścią mail wysłanych przez stronę www, mianowicie:

dostaje maila w takiej postaci:
(IMG:http://obrazki.elektroda.pl/4187667900_1481633672_thumb.jpg) [/img]

  1. <?php
  2. header('Content-type: application/json');
  3. $status = array(
  4. 'type'=>'Sukces!',
  5. 'message'=>'Dziekujemy za wyslanie wiadomosci, skontaktujemy sie z Toba!'
  6. );
  7.  
  8. $name = @trim(stripslashes($_POST['name']));
  9. $email = @trim(stripslashes($_POST['email']));
  10. $subject = @trim(stripslashes($_POST['subject']));
  11. $message = @trim(stripslashes($_POST['message']));
  12.  
  13. $email_from = $email;
  14. $email_to = 'moj@mail.com';//replace with your email
  15.  
  16. $body = 'Imie: $name' . $name . "\n\n" . 'Email: ' . $email . "\n\n" . 'Temat: $subject' . $subject . "\n\n" . 'Wiadomosc: ' . $message;
  17.  
  18. $success = @mail($email_to, $subject, $body, 'Od: <'.$email_from.'>');
  19.  
  20. echo json_encode($status);


kod html:
  1. <div class="row contact-wrap">
  2. <div class="status alert alert-success" style="display: none"></div>
  3. <form id="main-contact-form" class="contact-form" name="contact-form" method="post" action="send.php">
  4. <div class="col-sm-5 col-sm-offset-1">
  5. <div class="form-group">
  6. <label>Imię i nazwisko *</label>
  7. <input type="text" name="name" class="form-control" required="required">
  8. </div>
  9. <div class="form-group">
  10. <label>Email *</label>
  11. <input type="email" name="email" class="form-control" required="required">
  12. </div>
  13. <div class="form-group">
  14. <label>Telefon kontaktowy</label>
  15. <input type="number" class="form-control">
  16. </div>
  17. <div class="form-group">
  18. <label>Nazwa firmy</label>
  19. <input type="text" class="form-control">
  20. </div>
  21. </div>
  22. <div class="col-sm-5">
  23. <div class="form-group">
  24. <label>Temat wiadomości *</label>
  25. <input type="text" name="subject" class="form-control" required="required">
  26. </div>
  27. <div class="form-group">
  28. <label>Treść wiadomości *</label>
  29. <textarea name="message" id="message" required="required" class="form-control" rows="8"></textarea>
  30. </div>
  31. <div class="form-group">
  32. <button type="submit" name="submit" class="btn btn-primary btn-lg" required="required">Wyślij wiadomość</button>
  33. </div>
  34. </div>
  35. </form>
  36. </div>
Go to the top of the page
+Quote Post

Posty w temacie
- pawelalfa   [php] - Problem z treścią maila (send.php)   14.12.2016, 11:19:30
- - nospor   Jestes pewien ze pokazujesz nam wlasciwy kod php? ...   14.12.2016, 16:06:52
|- - pawelalfa   Cytat(nospor @ 14.12.2016, 16:06:52 )...   14.12.2016, 16:10:52
- - nospor   CytatKolego wszystko jest ok, po prostu mam innego...   14.12.2016, 16:13:03
|- - pawelalfa   Cytat(nospor @ 14.12.2016, 16:13:03 )...   14.12.2016, 16:16:30
- - Tomplus   W twoim przypadku najlepiej po funkcji header. Fu...   14.12.2016, 17:51:01
|- - pawelalfa   Cytat(Tomplus @ 14.12.2016, 17:51:01 ...   14.12.2016, 20:51:11
- - viking   Rozumiem że to ajaksem wysyłasz? Wszystkie dane ma...   14.12.2016, 20:56:53
- - pawelalfa   Kolego viking, tak. Używam AJAX. Niestety kontakt ...   15.12.2016, 09:20:49
- - viking   To zleć komuś kto ma większe pojęcie. Może być wsz...   15.12.2016, 09:51:42
- - pawelalfa   [PHP] pobierz, plaintext var form = $('#main-...   15.12.2016, 10:03:15
- - nospor   W tej chwili ajaxem nie wysylasz zadnych parametro...   15.12.2016, 10:08:23
- - pawelalfa   Ok, poradziłem sobie z tym. Mam jeszcze jedno py...   15.12.2016, 10:24:52
- - arturpiotrowski   a same pliki php jakie mają kodowanie? w funkcji m...   15.12.2016, 21:04:30
- - pawelalfa   Kodowanie mam ustawione na UTF-8:   16.12.2016, 08:14:37
- - viking   Jak application/json to nie text/plain   16.12.2016, 08:26:34
- - pawelalfa   Niestety, jak zostawiam: Content-type: application...   16.12.2016, 09:31:09
- - viking   To jest kodowanie odpowiedzi json a jak zrobić kod...   16.12.2016, 09:41:34
- - pawelalfa   Próbuje i dalej mi to nie wychodzi.. Czy możesz ...   16.12.2016, 11:08:43
- - viking   Jakoś tak zawsze wszystkim nie chodzi ale kodu nie...   16.12.2016, 12:01:01
- - pawelalfa   [PHP] pobierz, plaintext <?php header('Cont...   16.12.2016, 12:24:06
- - viking   Jako 4 parametr funkcji mail.   16.12.2016, 12:41:43


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: 17.10.2025 - 12:01