Monday, June 7, 2010

Oscommerce email subject line utf-8 encoded

In includes/classes/email.php (both of them, there's one in admin/includes/classes/ too) look for the following:

1. Just before this:

if (EMAIL_TRANSPORT == 'smtp') {
return mail(...);
} else {
return mail(...);
}

add the line:
$subject = '=?utf-8?B?' . base64_encode($subject) . '?=';


2.

ADD:
$to_name = '=?utf-8?B?' . base64_encode($to_name) . '?=';
$from_name = '=?utf-8?B?' . base64_encode($from_name) . '?=';

BEFORE:
$to = (($to_name != '') ? '"' . $to_name . '" <' . $to_addr . '>' : $to_addr);
$from = (($from_name != '') ? '"' . $from_name . '" <' . $from_addr . '>' : $from_addr);