Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

How to send right to left emails


Recommended Posts

Hi all,


First i changed the encoding to 'utf-8' in the email class.

I did receive a nice email in Hebrew but it is displayed from left to right. It should be displayed right to left.


It is my beliefe i can wrap the email text with <span dir='rtl'>.

I assume the email will be displayed aligend left but from right to left ( still readable)


I also assume that wrapping text with <div style="width:100%; text-align:right"><span dir='rtl'>

will result in a correct way. but what about the subject line then?




Does anyone know the correct way to go about it?





Link to comment
Share on other sites

the subject line may be problematic. the subject can be utf 8 encoded, so you can get it to display in hebrew instead of a latin character set. but it's up to the email client to decide to display that in rtl orientation rather than ltr. some clients might assume that it should be rtl for hebrew, since that's how the language works, but no guarantees.


to encode the subject, use the following:

$subject = '=?utf8?B?' . $subject . '?=';


put that just before the call to mail() in includes/classes/email.php


if utf8 doesn't work, you can try using iso-8859-8 instead, as that will let the email client know that the text is in hebrew.

Link to comment
Share on other sites

  • 3 months later...

I have tried to force the email text to show up right to left for the hebrew emails but no matter what I do it doesnt respond.


Does anyone have a suggestion? Here is the code I am using:

define('EMAIL_TEXT', '<span dir=rtl><div style="width:100%; text-align:right">מעתה תוכלי להנות ממגוון השירותים שאנו שמחים להציע לך. בין השירותים שלנו

- עגלת קניות שמורה - כל פריט שתוסיפי לעגלה ישאר שם עד שתמחקי אותו או עד

שתבצעי הזמנה.

- ספר כתובות - את ההזמנות שלך ניתן לשלוח לכתובות אחרות חוץ מהכתובת שלך! זוהי

דרך מצויינת לשלוח מתנות יום הולדת ומתנות ללידה ישירות לחברות ובנות משפחה.

- היסטוריית הזמנות - צפי בכל ההזמנות שביצעת דרך האתר שלנו.

- דירוג גולשות - שתפי את שאר הגולשות שלנו בדעתך על מוצרים הנמכרים באתר </span></div>' . "\n\n");


thank you


Link to comment
Share on other sites


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

  • Create New...