Witam
Sciagnalem z jakiejś strony taką oto funkcje do wysyłania formularzy z html-em :

  1. <?php
  2. function send_mail($emailaddress, $emailsubject, $body, $type = "html", $fromaddress = "mail@mail.com", $namefrom = "Site name")
  3. {
  4. $eol="\n";
  5. $mime_boundary=md5(time());
  6.  
  7. # Common Headers
  8. $headers .= "From: $namefrom <$fromaddress>".$eol;
  9. $headers .= "Reply-To: $namefrom <$fromaddress>".$eol;
  10. $headers .= "Return-Path: $namefrom <$fromaddress>".$eol;
  11.  
  12. // these two to set reply address
  13. $headers .= "Message-ID: <".$now." TheSystem@".$_SERVER['SERVER_NAME'].">".$eol;
  14. $headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
  15.  
  16. # Boundry for marking the split & Multitype Headers
  17. $headers .= 'MIME-Version: 1.0'.$eol;
  18. $headers .= "Content-Type: multipart/related; boundary=\"".$mime_boundary."\"".$eol;
  19.  
  20. $msg = "";
  21.  
  22.  
  23. # Setup for text OR html
  24. $msg .= "Content-Type: multipart/alternative".$eol;
  25.  
  26. # Text Version
  27. if($type == "text") {
  28. $msg .= "--".$mime_boundary.$eol;
  29. $msg .= "Content-Type: text/plain; charset=UTF-8".$eol;
  30. $msg .= "Content-Transfer-Encoding: 8bit".$eol;
  31. $msg .= strip_tags(str_replace("<br>", "\n", $body)).$eol.$eol;
  32. }
  33. # HTML Version
  34. else if($type == "html") { 
  35. $msg .= "--".$mime_boundary.$eol;
  36. $msg .= "Content-Type: text/html; charset=UTF-8".$eol;
  37. $msg .= "Content-Transfer-Encoding: 8bit".$eol;
  38. $msg .= $body.$eol.$eol;
  39. } 
  40. $msg .= "--".$mime_boundary."--".$eol.$eol; // finish with two eol's for better security. see Injection.
  41.  
  42. if ( mail($emailaddress, $emailsubject, $msg, $headers) ) return 1;
  43. else return 0;
  44. }
  45. ?>


a następnie wywołuje ją w taki oto sposób :
  1. <?php
  2. $mail_message .= "<b>ID :</b> ".$mail_fromid."<br />";
  3. $mail_message .= "<b>od :</b> ".$mail_frommail."<br />";
  4. $mail_message .= "<b>IP :</b> ".$mail_ip."<br /><br />".$_POST['mail_message'];
  5.  
  6. send_mail(MAIL_RECEIVER, $mail_topic, $mail_message, "text" ,$mail_frommail, "Binfo.com - kontakt")
  7. ?>


niestety kiedy mail dochodzi, wszystki jest wporządku oprocz treści...w ww. przypadku mail dochodzi bez treści natomiast jeśli przy wywoływaniu funkcji send_mail(), zamiast $mail_message podam $_POST['mail_message'] to wszystko łącznie z treścią maila działa ok.

Mało tego, jeśli wywołam sobie zmienną $mail_message za pomocą echo, wszystko elegancko się pokazuje. Mysle więc, że to jakiś problem związany z zasadami, którymi rządzi się zawartość emaila...

Pozdrawiam i proszę o pomysły winksmiley.jpg