Make WordPress Core

Opened 11 years ago

Closed 10 years ago

Last modified 10 years ago

#4197 closed defect (bug) (wontfix)

Bad headers generated when using non-western encoding

Reported by: yaman666 Owned by:
Milestone: Priority: normal
Severity: normal Version: 2.1.3
Component: General Keywords: reporter-feedback
Focuses: Cc:


wp_mail function does not bother encoding headers, to and from fields, which generates "bad header" error in anti-spam software and increases chances of flagging it as spam.

Possible solution to encode subject and message that worked for me:

$subject = "=?UTF-8?B?".base64_encode($subject)."?="; $message = chunk_split(base64_encode($message)); $headers = "From: $from\n"

."MIME-Version: 1.0\n" ."Content-Type: text/plain; charset=UTF-8; format=flowed\n" ."Content-Transfer-Encoding: base64\n" ."Content-Disposition: inline\n";

mail($to, $subject, $message, $headers);

Change History (5)

#1 @foolswisdom
11 years ago

  • Milestone changed from 2.1.4 to 2.3

yaman666, please look at the code in trunk as this code has changed significantly.

Still an issue?

#2 @rob1n
11 years ago

  • Keywords reporter-feedbac added
  • Milestone changed from 2.3 to 2.4

Yes, I believe we had this problem before, and was part of the reason why we switched to PHPMailer. Please check with the current trunk.

#3 @rob1n
11 years ago

  • Keywords reporter-feedback added; reporter-feedbac removed

#4 @thee17
10 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

Closing as invalid as there was no reporter feed back in months.

#5 @thee17
10 years ago

  • Milestone 2.5 deleted
Note: See TracTickets for help on using tickets.