Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: PHP + mail w formacie HTML
Forum PHP.pl > Forum > PHP
piterqs
Jak wyslac maila z php w formacie html?
olus
Kod
/* adresaci */

$to  = "Mary <mary@example.com>" . ", "; //zwróc uwagę na przecinek

$to .= "Kelly <kelly@example.com>";



/* temat */

$subject = "Birthday Reminders for August";



/* wiadomość */

$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>

  <td>Sally</td><td>17th</td><td>August</td><td>1973</td>

</tr>

</table>

</body>

</html>

';



/* *******************************************

A TU JEST JAK WYSŁAĆ MAILA W HTML'owym formacie

*********************************************** */



/* Aby wysłać e-mail w foramcie HTML, należy ustawić nagłówek Content-type. */

$headers  = "MIME-Version: 1.0rn";

$headers .= "Content-type: text/html; charset=iso-8859-1rn";



/* dodatkowe nagłówki */

$headers .= "From: Birthday Reminder <birthday@example.com>rn";



$headers .= "Cc: birthdayarchive@example.comrn";

$headers .= "Bcc: birthdaycheck@example.comrn";



/* a teraz wyślij */

mail($to, $subject, $message, $headers);


Cytat
DOBRA JA TO TEŻ NAPISZE patrzcie czasami qurwa do MANUALA
wool
...
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";

/* dodatkowe nagłówki */
$headers .= "From: Birthday Reminder <birthday@example.com>rn";

olus jesteś pewien że nagłówki w taki sposób zostaną dobrze wysłane ? Robiłem coś podobnego i przesłana została tyko jesdna, ostatnia zmienna $headers. Dopiero jak przerobiłem to w jedną zmienną poszło OK.
em1X
mail ($do_kogo, $temat, $tresc_majla, "From: twoj@mail.plnContent-type: text/html");

tongue.gif
steru
Cytat
...
$headers = "MIME-Version: 1.0rn";
$headers .= "Content-type: text/html; charset=iso-8859-1rn";

/* dodatkowe nagłówki */
$headers .= "From: Birthday Reminder <birthday@example.com>rn";

olus jesteś pewien że nagłówki w taki sposób zostaną dobrze wysłane ? Robiłem coś podobnego i przesłana została tyko jesdna, ostatnia zmienna $headers. Dopiero jak przerobiłem to w jedną zmienną poszło OK.

dobrzzz bedzie
olus
tak napisano w manualu


chyba ze ty korzystales z CZESKIEJ wersjii manuala ja tam nie wiem... laugh.gif angrysmiley.gif
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.