Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Wysyłanie email'a w formie html, a style
tomekp
post
Post #1





Grupa: Zarejestrowani
Postów: 171
Pomógł: 0
Dołączył: 17.12.2003
Skąd: Krakół

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


Witam, nie mam problemu z wysyłaniem emaili, ale zastanawiam się dlaczego nie uwzględnia mi styli w pliku html, kod wygląda następująco:
  1. <?php
  2. include('Mail.php');
  3. include('Mail/mime.php');
  4.  
  5. $message = new Mail_mime();
  6. $text = file_get_contents("mail_text.txt");
  7. $html = file_get_contents("register.html");
  8.  
  9. $message->setTXTBody($text);
  10. $message->setHTMLBody($html);
  11. $body = $message->get();
  12. $extraheaders = array("From"=>"me@example.com", "Subject"=>"My Subject 7");
  13. $headers = $message->headers($extraheaders);
  14.  
  15. $mail = Mail::factory("mail");
  16. $mail->send("adres@email.pl", $headers, $body);
  17. ?>

Plik register.html wyglada następująco:
  1. <style type="text/css">
  2. body {
  3.      font-family: Verdana, Arial, sans-serif;
  4.      margin: 0px;
  5. }
  6.  
  7. td {
  8.      font-family: Verdana, Arial, sans-serif;
  9.      font-size: 11px;
  10. }
  11.  
  12. .link {
  13.      FONT-FAMILY: Verdana, Arial, sans-serif;
  14.      FONT-WEIGHT: bold;
  15.      FONT-SIZE: 11px;
  16.      MARGIN-LEFT: 0px;
  17.      COLOR: #000000;
  18.      TEXT-DECORATION: none;
  19. }
  20.  
  21. a.link:hover {
  22.      COLOR: #000000;
  23.      TEXT-DECORATION: underline;
  24. }
  25. <body background="#FFFFFF">
  26. <table width="700" cellpadding="5" cellspacing="1" border="0">
  27. <tr>
  28. <td width="300" valign="top">
  29. ...[snip]...


Ma ktoś jakiś pomysł dlaczego jest z tym problem?
Go to the top of the page
+Quote Post

Posty w temacie


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: 24.12.2025 - 00:13