WordPress.org

Make WordPress Core

Opened 7 years ago

Closed 6 years ago

Last modified 6 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:

Description

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)

comment:1 foolswisdom7 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?

comment:2 rob1n7 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.

comment:3 rob1n7 years ago

  • Keywords reporter-feedback added; reporter-feedbac removed

comment:4 thee176 years ago

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

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

comment:5 thee176 years ago

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