Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Text direction and alignment in email sent via email() using PHP

I am sending an automatic email via php. The email contains Hebrew which direction is right to left. Here is my code for making up the body part of the message:

            $emailMessage ='
            <html lang="HE">
                <head>
                <title>
                    job-skills | הצורפות
                </title>
                </head>
                <body style="text-align:right; direction:rtl;">
                    <table>
                        <tr>
                            <td><h3>תודה על הצטרפותך</h4></td>
                        </tr>
                        <tr>
                            <td>על מנת להצטרף סופית לאתר עליך ללחץ על הלינק הבא:</td>
                        </tr>
                        <tr>
                            <td><a href="http://localhost/W-DB/php/registration_and_login/confirm_registration.php?email=' .$registrationEmail .'&tempPass=' . $tempPass . '>לחץ כאן</a></td>
                        <tr>
                        </tr>
                        <tr>
                            <td>בברכה,</td>
                        </tr>
                        <tr>
                            <td><h2>JOb-Skills</h2></td>
                        </tr
                    </table>
                </body>
            </html>

still the text aligned to left and direction left to right.

like image 850
vlio20 Avatar asked Oct 09 '12 12:10

vlio20


1 Answers

Try adding dir="rtl" to your HTML tag.

like image 110
Varun Bansal Avatar answered Oct 24 '22 05:10

Varun Bansal