Hola amigos tengo el siguiente codigo:
$to = '[email protected], [email protected]';
$subject = 'Website Change Reqest';
$message = '<html>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test HTML</title>
</head>
<body style="margin:0px; background: #f8f8f8; ">
<div width="100%" style="background: #f8f8f8; padding: 0px 0px; font-family:arial; line-height:28px; height:100%; width: 100%; color: #514d6a;">
<div style="max-width: 700px; padding:50px 0; margin: 0px auto; font-size: 14px">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%; margin-bottom: 20px">
<tbody>
<tr>
<td style="vertical-align: top; padding-bottom:30px;" align="center"><a href="http://eliteadmin.themedesigner.in" target="_blank"><br/>
</a> </td>
</tr>
</tbody>
</table>
<div style="padding: 40px; background: #fff;">
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%;">
<tbody>
<tr>
<td><b>Dear Sir/Madam/Customer</b>
<p>This is to inform you that, Your account with Elite Admin has been created successfully. Log it for more details.</p>
<a href="javascript: void(0);" style="display: inline-block; padding: 11px 30px; margin: 20px 0px 30px; font-size: 15px; color: #fff; background: #00c0c8; border-radius: 60px; text-decoration:none;"> Call to action button </a>
<p>This email template can be used for Create Account, Change Password, Login Information and other informational things.</p>
<b>- Thanks (Test)</b> </td>
</tr>
</tbody>
</table>
</div>
<div style="text-align: center; font-size: 12px; color: #b2b2b5; margin-top: 20px">
<p> Ok sender<br>
<a href="javascript: void(0);" style="color: #b2b2b5; text-decoration: underline;">Unsubscribe</a> </p>
</div>
</div>
</div>
</body>
</html>';
// To send HTML mail, the Content-type header must be set
$headers[] = 'MIME-Version: 1.0';
$headers[] = 'Content-type: text/html; charset=iso-8859-1';
// Additional headers
$headers[] = 'To: AQ <[email protected]>, SQ <[email protected]>';
$headers[] = 'From: Example Email <[email protected]>';
$headers[] = 'Cc: [email protected]';
$headers[] = 'Bcc: [email protected]';
if(mail($to, $subject, $message, implode("\r\n", $headers))){
echo 'Mail Sent';
}else{
echo 'Mail NOT Sent';
exit();
}
con este codigo intento enviar un correo HTML pero no logro realizar que me envie correctamente , ahora bien si cambio a texto plano:
$headers[] = 'Content-type: text/plain; charset=iso-8859-1';
Logro enviar el correo solamente con este formato
Uso SSMTP en Linux
Alguna sugerencia de que puedo estar haciendo mal.
Gracias.
print_r(error_get_last());
, en el caso no envía y obtener el último error.