Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 30068

PHP mail headers "base64 encoded unnecessarily"

$
0
0

What I have:

I'm using the PHP mail function to send an email. My headers are as follows:

<?php
    $headers = "MIME-Version: 1.0\r\n"
               ."Content-Type: text/plain; charset=utf-8\r\n"
               ."Content-Transfer-Encoding: 8bit\r\n"
               ."From: =?UTF-8?B?". base64_encode($from_name) 
               ."?= <$from_address>\r\n"
               ."X-Mailer: PHP/". phpversion();
    mail($to, $subject, $body, $headers, "-f $from_address");
    ?>

This code is sourced from an accepted stackoverflow answer: https://stackoverflow.com/a/2801159/835950

My problem:

Spam Assassin is applying a 0.1 penalty for the following reason:

0.1 FROM_EXCESS_BASE64 From: base64 encoded unnecessarily

My question:

How should I modify my headers to avoid this penalty. Do I simply remove the base64_encode function?


Viewing all articles
Browse latest Browse all 30068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>