Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Problem przy funkcji mail
Alik
post 20.09.2006, 23:07:20
Post #1





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 4.06.2006

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


Witam,
mam problem, ponieważ niewiem czemu ale kiedy wysyłam mail ze strony, na web maila przychodzi mi ładnie w HTML ale już na Outlooka przychodzi mi cały kod HTML maila.
Próbowałem wszystkie blokady w Outlooku pozdejmować ale dalej mam to samo.
Kod strony do wysłania mail jest napewno prawidłowy bo pochodzi z manula php.
Myślę że trzeba coś przestawić w Outlooku tylko co?questionmark.gif
Z góry dziękuje za chęć pomocy.
Go to the top of the page
+Quote Post
JohnySpot
post 21.09.2006, 07:55:59
Post #2





Grupa: Zarejestrowani
Postów: 106
Pomógł: 0
Dołączył: 9.09.2003
Skąd: Włocławek

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


Mogę się tylko domyślać, ale sprawdź gdzieś dokładniej, czy nie trzeba jakiś dodatkowych nagłówków poustawiać, żeby otlook wiedział, że to HTML. Sprawdź jeszcze w innym kliencie - Thunderbird.

(P.S) albo wrzuć tu skrypt, lub link do phps to pokombinujemy


--------------------
Go to the top of the page
+Quote Post
Alik
post 21.09.2006, 08:27:48
Post #3





Grupa: Zarejestrowani
Postów: 8
Pomógł: 0
Dołączył: 4.06.2006

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


Skrypt:

<?php
// multiple recipients
$to = 'marecki@wbs.pl';

// subject
$subject = 'Birthday Reminders for August';

// message
$message = '
<html>
<head>
<title>Birthday Reminders for August</title>
</head>
<body>
<p>Here are the birthdays upcoming in August!</p>
<table>
<tr>
<th>Person</th><th>Day</th><th>Month</th><th>Year</th>
</tr>
<tr>
<td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
</tr>
<tr>
<td>Sally</td><td>17th</td><td>August</td><td>1973</td>
</tr>
</table>
</body>
</html>
';

// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";

// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";

// Mail it
mail($to, $subject, $message, $headers);
?>
Go to the top of the page
+Quote Post
JohnySpot
post 21.09.2006, 08:45:17
Post #4





Grupa: Zarejestrowani
Postów: 106
Pomógł: 0
Dołączył: 9.09.2003
Skąd: Włocławek

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


Nie wiem czy Ci to coś pomorze:
W dokumentacji php (http://pl2.php.net/manual/pl/ref.mail.php) zwróciłem uwagę na ten kod:

  1. <?php
  2. //add From: header
  3. $headers = "From: webserver@localhostrn";
  4.  
  5. //specify MIME version 1.0
  6. $headers .= "MIME-Version: 1.0rn";
  7.  
  8. //unique boundary
  9. $boundary = uniqid("HTMLDEMO");
  10.  
  11. //tell e-mail client this e-mail contains//alternate versions
  12. $headers .= "Content-Type: multipart/mixed; boundary = $boundaryrnrn";
  13.  
  14. //plain text version of message
  15. $body = "--$boundaryrn" .
  16.  "Content-Type: text/plain; charset=ISO-8859-1rn" .
  17.  "Content-Transfer-Encoding: base64rnrn";
  18. $body .= chunk_split(base64_encode("This is the plain text version!"));
  19.  
  20. //HTML version of message
  21. $body .= "--$boundaryrn" .
  22.  "Content-Type: text/html; charset=ISO-8859-1rn" .
  23.  "Content-Transfer-Encoding: base64rnrn";
  24. $body .= chunk_split(base64_encode("This the <b>HTML</b> version!"));
  25.  
  26. //send message
  27. mail("root@localhost", "An HTML Message", $body, $headers);
  28. ?>


Przyjżyj się temu bliżej

i tu: http://www.phpguru.org/static/htmlMimeMail5.html


--------------------
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 Wersja Lo-Fi Aktualny czas: 12.07.2025 - 20:22