Napisałem kod wysyłający e-maila w formacie html jednak nie działa on do końca. Otrzymuje taki efekt:
To jest wiadomość wieloczęściowa w formacie MIME.
Kod
--==Multipart_Boundary_zzz582x Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: 7bit
--==Multipart_Boundary_zzz582x Content-Type: text/html; charset="iso-8859-2"
Content-Transfer-Encoding: 7bit
<html>
<body>
<p><b>html</b></p>
</body>
</html>
--==Multipart_Boundary_zzz582x--
pewnie popełniłem jakąś literówkę ;/
zerknijcie na kod:
<?
class mailer {
public $to = "agencik@gmail.com";
public $to_full = "Temat";
public $form = "agencik@gmail.com";
public $forum_full = "Lukasz Ogan";
public $subject = "Test wiadomości";
public $random_hash = "zzz582x";
function send()
{
?>
Do:
<? echo $this->to_full; ?> <
<? echo $this->to; ?>>
Od:
<? echo $this->from_full; ?> <
<? echo $this->form; ?>>
MIME-Version: 1.0
Content-Type: multipart/alternative;
boundary="==Multipart_Boundary_
<? echo ("$this->random_hash\n"); ?>"
<?
?>
To jest wiadomość wieloczęściowa w formacie MIME.
--==Multipart_Boundary_
<? echo $this->random_hash; ?> Content-Type: text/plain; charset="iso-8859-2"
Content-Transfer-Encoding: 7bit
--==Multipart_Boundary_
<? echo $this->random_hash; ?> Content-Type: text/html; charset="iso-8859-2"
Content-Transfer-Encoding: 7bit
<html>
<body>
<p><b>html</b></p>
</body>
</html>
--==Multipart_Boundary_
<? echo $this->random_hash; ?>--
<?
$slij = mail($this->to, $this->subject, $message, $headers); echo ($slij ?
"Wiadomość wysłano\n" : "Wysłanie wiadomości nie powiodło się \n");
}
}
$mail = new mailer;
$mail->send();