duanliaolan6178 2012-10-09 12:26
浏览 127
已采纳

使用PHP通过email()发送的电子邮件中的文本方向和对齐方式

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.

  • 写回答

4条回答 默认 最新

  • dpj997991 2012-10-10 12:22
    关注

    Here is my code:

    <?php 
    $to ="mail id";
    $from = "mail id";
    $sub = "Hebrew";
    $message = '<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="#">לחץ כאן</a></td>
                            <tr>
                            </tr>
                            <tr>
                                <td>בברכה,</td>
                            </tr>
                            <tr>
                                <td><h2>JOb-Skills</h2></td>
                            </tr
                        </table>
                    </body>
                </html>';
    $headers = "From:" . $from;
    $headers = 'MIME-Version: 1.0' . "
    ";
    $headers .= 'Content-type: text/html; charset=utf-8' . "
    ";
    if(mail($to,$sub,$message,$headers)) echo "success";
    
    
    
    ?>
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(3条)

报告相同问题?

悬赏问题

  • ¥15 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?