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 Oracle中如何从clob类型截取特定字符串后面的字符
  • ¥15 想通过pywinauto自动电机应用程序按钮,但是找不到应用程序按钮信息
  • ¥15 MATLAB中streamslice问题
  • ¥15 如何在炒股软件中,爬到我想看的日k线
  • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
  • ¥15 seatunnel 怎么配置Elasticsearch
  • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
  • ¥15 (标签-MATLAB|关键词-多址)
  • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
  • ¥500 52810做蓝牙接受端