Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [HTML][PHP]Wysyłanie maili
XxmanxX
post
Post #1





Grupa: Zarejestrowani
Postów: 51
Pomógł: 0
Dołączył: 22.07.2009

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


Witam, czy możecie sprawdzić mi kod. Czasami w otrzymanym mailu są widoczne znaczniki albo tekst nie ma określonych kolorow lub wartość funkcji date('d-m-Y / H:i',$problem_start_date_time) zamiast znajdować się po "Problem start date / time:"
jest gdzieś na początku

  1. $to=$zmienna;
  2. $subject ="SUBJECT";
  3. $message ="<STYLE type='text/css'>th.title{color:white;background-color:red;font-size:40px} td{width:320;font-family:sans-serif;font-size:14px;font-weight:bold} td.description{color:black}</STYLE>";
  4. $message .="<table border=0 cellpadding=0 cellspacing=1 width='100%'><tr><th class='title'>HEADER</th></tr></table>";
  5. $message .="<div class='description'><p>TEXT</p><p>TEXT:</p></div>";
  6. $message .="<table border=0 cellpadding=7 cellspacing=1 width='100%'><tr><td>Message date / time:</td><td>".date('d-m-Y / H:i')."</td></tr>";
  7. $message .="<tr><td>Service:</td><td><font color=red>$result[category] -> $result[service]</font></td></tr>";
  8. $message .="<tr><td>Status:</td><td><font color=red>DETECTED AND OPEN</font></td></tr>";
  9. $message .="<tr><td>Problem description:</td><td><font color=red>".nl2br($_POST[problem_description])."</font></td></tr>";
  10. $message .="<tr><td>Main impacted applications & services:</td><td><font color=red>".nl2br($_POST[main_impacted])."</font></td></tr>";
  11. $message .="<tr><td>Problem start date / time:</td><td>".date('d-m-Y / H:i',$problem_start_date_time)."</td></tr></table>";
  12. $message .="<div class='description'><p>TEXT</p><p>TEXT</p><p>TEXT</p><p>TEXT</p>
  13. <p>
  14. -------------------------------------------------------------------------------------<br/>
  15. <b>FOOTER</b><br/>
  16. -------------------------------------------------------------------------------------<br/>
  17. <i>This is an automatic email. Please, do not reply.</i></p></div>";
  18. $headers ="MIME-Version: 1.0"."\n";
  19. $headers .="Content-type: text/html; charset=iso-8859-2"."\n";
  20. $headers .="Content-Transfer-Encoding: 8bit"."\n";
  21. $headers .="From: admin@domain.com"."\n";
  22. $mailsent = mail($to,$subject,$message,$headers);


Czy w wiadomościach moze byc CSS czy lepiej wszystko html zastąpić ?
Pozdrawiam
Go to the top of the page
+Quote Post

Posty w temacie


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 - 14:36