I have a system in which I send an email when I assign a job to an employee, the code is as follows:
$para = $correo;
$titulo = 'Nuevo Servicio';
$mensaje = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Nuevo Servicio</title>
</head>
<body>
<div>
<p>Tienes un nuevo servicio en tu bandeja de entrada, verificalo en el sistema: <b><a href="web.com">web.com</a></b></p>
</div>
</body>
</html>';
$cabeceras = 'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
$success = mail($para, $titulo, $mensaje, $cabeceras);
And it seems that everything is fine, but the mail that arrives looks like this:
It doesn't respect my HTML code at all
You are missing the HTML Content-Type header.