Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PHP send plain text mail and force fixed-width charset

I want to force the reader's email client to display my php-generated plain text emails with a fixed width charset. Thunderbird displays the email with a fixed width charset. However, Gmail and Outlook (and probably more clients) do not.

Is this a config setting with my mail server or something I'm doing wrong? Any help would be greatly appreciated.

These are the headers I'm currently using:

    $header = "MIME-Version: 1.0\r\n"; 
    $header .= "Content-type: text/plain; charset=ISO-8859-1; format=flowed\r\n"; 
    $header .= "Content-Transfer-Encoding: 7bit\r\n"; 
    $header .= "X-Mailer: PHP" . phpversion() ."\r\n"; 
    $header .= "From: [email protected]\r\n";
    $header .= "Reply-To: [email protected]\r\n";
like image 871
Antony Avatar asked Nov 02 '25 05:11

Antony


1 Answers

You cannot force the plain text message to use any specific font. The best you can do is send HTML email using the monospace font family.

like image 117
Ignacio Vazquez-Abrams Avatar answered Nov 03 '25 19:11

Ignacio Vazquez-Abrams



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!