• <bdo id='fzFwU'></bdo><ul id='fzFwU'></ul>

      <small id='fzFwU'></small><noframes id='fzFwU'>

      <i id='fzFwU'><tr id='fzFwU'><dt id='fzFwU'><q id='fzFwU'><span id='fzFwU'><b id='fzFwU'><form id='fzFwU'><ins id='fzFwU'></ins><ul id='fzFwU'></ul><sub id='fzFwU'></sub></form><legend id='fzFwU'></legend><bdo id='fzFwU'><pre id='fzFwU'><center id='fzFwU'></center></pre></bdo></b><th id='fzFwU'></th></span></q></dt></tr></i><div id='fzFwU'><tfoot id='fzFwU'></tfoot><dl id='fzFwU'><fieldset id='fzFwU'></fieldset></dl></div>
        <tfoot id='fzFwU'></tfoot>
      1. <legend id='fzFwU'><style id='fzFwU'><dir id='fzFwU'><q id='fzFwU'></q></dir></style></legend>

        主题或消息中包含特殊字符的电子邮件的 PHP 邮件标头

        PHP Mail header for emails with special characters in the subject or message(主题或消息中包含特殊字符的电子邮件的 PHP 邮件标头)
              <bdo id='VlBrl'></bdo><ul id='VlBrl'></ul>
            • <legend id='VlBrl'><style id='VlBrl'><dir id='VlBrl'><q id='VlBrl'></q></dir></style></legend>
                <tbody id='VlBrl'></tbody>
            • <i id='VlBrl'><tr id='VlBrl'><dt id='VlBrl'><q id='VlBrl'><span id='VlBrl'><b id='VlBrl'><form id='VlBrl'><ins id='VlBrl'></ins><ul id='VlBrl'></ul><sub id='VlBrl'></sub></form><legend id='VlBrl'></legend><bdo id='VlBrl'><pre id='VlBrl'><center id='VlBrl'></center></pre></bdo></b><th id='VlBrl'></th></span></q></dt></tr></i><div id='VlBrl'><tfoot id='VlBrl'></tfoot><dl id='VlBrl'><fieldset id='VlBrl'></fieldset></dl></div>

              <small id='VlBrl'></small><noframes id='VlBrl'>

                <tfoot id='VlBrl'></tfoot>

                  本文介绍了主题或消息中包含特殊字符的电子邮件的 PHP 邮件标头的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我的代码:

                  $to      = 'example@example.com';
                  $subject = $_REQUEST['subject'] ;
                  $message = $_REQUEST['message'] ;
                  $header = "From: noreply@example.com
                  "; 
                  $header.= "MIME-Version: 1.0
                  "; 
                  $header.= "Content-Type: text/html; charset=ISO-8859-1
                  "; 
                  $header.= "X-Priority: 1
                  "; 
                  
                  mail($to, $subject, $message, $header);
                  

                  当我发送带有特殊字符的邮件时,例如 --,,在消息中,它可以工作,但不再处理间距(每个新行或空格都被删除)第二个问题是主题中没有显示特殊字符.他们只是输出如下: &#700;&#700;

                  When i send a mail with special characters such as --",, in the message, it works but spacing is no longer dealt with (every new line or space gets removed) And the second problem is that the special characters are not displayed in the subject. They just output like: &#700;&#700;

                  提前致谢!

                  推荐答案

                  内容类型:文本/html

                  Content-Type: text/html

                  如果您设置此标头,则意味着您必须将 HTML 发送给用户.您可以决定使用 TinyMCE 之类的工具,让用户在 Word 样式的编辑器中编写消息,并使用其中的 HTML 输出.或者将您的标题设置为纯文本.

                  If you set this header that means you have to send HTML to the user. You can either decide to use something like TinyMCE to let the user write the message in a Word-style editor and use the HTML output from that. Or set your headers to plaintext.

                  内容类型:文本/纯文本

                  Content-Type: text/plain

                  试试这个

                  $to      = 'example@example.com';
                  $subject = $_REQUEST['subject'] ;
                  $message = $_REQUEST['message'] ;
                  $header = "From: noreply@example.com
                  "; 
                  $header.= "MIME-Version: 1.0
                  "; 
                  $header.= "Content-Type: text/plain; charset=utf-8
                  "; 
                  $header.= "X-Priority: 1
                  "; 
                  
                  mail($to, $subject, $message, $header);
                  

                  这篇关于主题或消息中包含特殊字符的电子邮件的 PHP 邮件标头的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)
                    <tfoot id='bakKr'></tfoot>

                          <tbody id='bakKr'></tbody>
                          <bdo id='bakKr'></bdo><ul id='bakKr'></ul>

                          <legend id='bakKr'><style id='bakKr'><dir id='bakKr'><q id='bakKr'></q></dir></style></legend>
                        • <small id='bakKr'></small><noframes id='bakKr'>

                          <i id='bakKr'><tr id='bakKr'><dt id='bakKr'><q id='bakKr'><span id='bakKr'><b id='bakKr'><form id='bakKr'><ins id='bakKr'></ins><ul id='bakKr'></ul><sub id='bakKr'></sub></form><legend id='bakKr'></legend><bdo id='bakKr'><pre id='bakKr'><center id='bakKr'></center></pre></bdo></b><th id='bakKr'></th></span></q></dt></tr></i><div id='bakKr'><tfoot id='bakKr'></tfoot><dl id='bakKr'><fieldset id='bakKr'></fieldset></dl></div>