使用PHP通过email()发送的电子邮件中的文本方向和对齐方式 [英] Text direction and alignment in email sent via email() using PHP

查看:109
本文介绍了使用PHP通过email()发送的电子邮件中的文本方向和对齐方式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过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.

推荐答案

这是我的代码:

<?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' . "\r\n";
$headers .= 'Content-type: text/html; charset=utf-8' . "\r\n";
if(mail($to,$sub,$message,$headers)) echo "success";



?>

这篇关于使用PHP通过email()发送的电子邮件中的文本方向和对齐方式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆