Php mail: how to send html? Php mail: how to send html? php php

Php mail: how to send html?


use this header for the mail:

 $header  = "MIME-Version: 1.0\r\n"; $header .= "Content-type: text/html; charset: utf8\r\n";

and for the content/body:

<html>    <head>        <meta http-equiv="content-type" content="text/html; charset=utf-8" />... ... ...

it's important to use inline css commands and recommanded to use tables for the interface.

...

In your Mail-Body you than have to put HTML code with head and body


Have you looked at the headers of the incoming mail? It says

Reply-To: example@example.comContent-type: text/html

Simply add another \r\n here:

Reply-To: " . $from . "\r\n";


I recommend rather than messing around with doing this yourself you use one of the many free classes available all over the web to do it.

I would recommend: PHPMailer