Jump to content

Subject of UTF-8 e-mails and avoiding spam filters


vineld

Recommended Posts

When sending UTF-8 e-mails using mail() I have previously used this for the subject in order to make it UTF-8 encoded:

 

$subject = "=?UTF-8?Q?".$subject."?=";

 

This worked fine for the lower case versions of the non-English letters of the Swedish alphabet although the upper case versions screwed it, displaying the full string above as the e-mail subject. I then tried this:

 

$subject = "=?UTF-8?B?".base64_encode($subject)."?=";

 

which seems to work just fine so far. Why is this? Will this work for all languages?

 

I am also looking for the best way to avoid being caught in spam filters since these are automatic e-mails sent by various membership systems. Which headers should I use? Currently I am using these:

 

From

Reply-To

MIME-Version: 1.0

Content-type: text/plain; charset=UTF-8

 

Unfortunately the system e-mails often end up in spam folders which is not that good. Any help or guidance would be highly appreciated.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.