Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Missing letters in email confirmation subject


sak69GR

Recommended Posts

Posted

Hello everyone.

 

I've a problem with email confirmation's subject in greek language. There are missing letters only in email's subject. The rest of the email is OK.

I've to tell you that I've changed all of the files and database encoding in UTF8.

 

Can someone tell why this is happening and how to fix it ?

Posted
Hello everyone.

 

I've a problem with email confirmation's subject in greek language. There are missing letters only in email's subject. The rest of the email is OK.

I've to tell you that I've changed all of the files and database encoding in UTF8.

 

Can someone tell why this is happening and how to fix it ?

 

is your 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:

 

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

it should be near the bottom of the file.

 

just before this, add the line:

$subject = '=?utf-8?B?' . base64_encode($subject) . '?=';

 

this tells the smtp/pop servers that the subject line itself (not just the contents of the email) is utf-8 encoded data and should allow you to see all the characters. if not, pm me and i can help you further. i'd probably have to see one of your emails to get a better idea of what's going on.

  • 1 year later...
Posted
is your 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:

 

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

it should be near the bottom of the file.

 

just before this, add the line:

$subject = '=?utf-8?B?' . base64_encode($subject) . '?=';

 

this tells the smtp/pop servers that the subject line itself (not just the contents of the email) is utf-8 encoded data and should allow you to see all the characters. if not, pm me and i can help you further. i'd probably have to see one of your emails to get a better idea of what's going on.

 

 

thank arietis...was looking for a few hours now and could not find where exactly the problem was. Save me A LOT of time.

 

 

for those that want to extend the above solution I would add the below code to take care of the same problem with the TO and FROM lines as well

 

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

  • 1 year later...
Posted

I know this post is old.

 

This worked for me but my email client is Outlook or Outlook Express and I have to manually change the encoding to utf8, in the mail client, to show the email correctly. Does anyone else have this problem?

  • 8 months later...
Posted

I had the same problem.

I changed only 2 lines of code in line 550 like this:

 

// Make up the date header as according to RFC822

$date = 'Date: ' . date('D, d M y H:i:s');

//------------------------------------------------------------------

//Φτιάχνει τις Ελληνικές επικεφαλίδες.

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

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

//----------------------------------------------------------------------

 

$to = (($to_name != '') ? 'To: "' . $to_name . '" <' . $to_addr . '>' : 'To: ' . $to_addr);

$from = (($from_name != '') ? 'From: "' . $from_name . '" <' . $from_addr . '>' : 'From: ' . $from_addr);

 

I discovered that I had to change my other 2 lines of code in line: 494 like this:

 

if ((strstr($from_addr, "\n") != false) || (strstr($from_addr, "\r") != false)) {

return false;

}

//------------------------------------------------------------------

//Φτιάχνει τις Ελληνικές επικεφαλίδες.

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

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

//----------------------------------------------------------------------

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

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

 

After that everythin is working correctly in Microsoft Outlook.

  • 1 month later...

Archived

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

×
×
  • Create New...