Skip to content Skip to sidebar Skip to footer

Php Mail() Html - Sending As Plain Text

Folks, I have sent many emails over the years with PHP and never had an HTML problem. I launched a new Apache/PHP server the other day and emails send fine. All emails send as plai

Solution 1:

I assume, that your email client is considering the smtp-server "unsafe", and hence is just going to display all the html as plaintext, rather than rendering it. (To avoid triggering hidden scripts, which might be invoked by loading some linked resources like css or images)

PHPs mail() function uses the smtp-server as it is configured in your php.ini. Most of the time, there is nothing configured at all, so the server acts as "smtp-server" itself, which is guaranteed to be detected as spam cause about 99% of the most basic spam-checks will fail.

I would recommend to switch to some of the PHP-Mail-Clients available (such as https://github.com/PHPMailer/PHPMailer) and configure every email to be sent (using SMTP-Auth) with a server that is known to be a reliable and well configured SMTP-Server, instead of "localhost".

Post a Comment for "Php Mail() Html - Sending As Plain Text"