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);

3 comments:

OsCommerce Developer India said...

thanksf for providing such a nice information and code for Oscommerce email subject line.

Thanks again....

Sara said...

Why just use

mb_send_mail()

??

Anonymous said...

Very helpful, thanks!