Am descarcat un template HTML de mail si l-am modificat putin, insa cand site-ul trimite mail spre client (se completeaza formular), imi trimite tot codul HTML, cum as putea remedia asta? Sa fie afisat corect? Nu sub forma de text.
Acesta ar fi codul:
$body = file_get_contents('./template_mail/mail.html');
$headers = array (
'MIME-Version' => '1.0\r\n',
'Content-Type' => 'text/html; charset=UTF-8\r\n',
'From' => $from,
'To' => $to,
'Subject' => $subject);
$smtp = Mail::factory('smtp',
array ('host' => $host,
'auth' => true,
'username' => $username,
'password' => $password));
$mail = $smtp->send($to, $headers, $body);
Si in acest format primesc mail-ul: