Php 显示HTML标记而不是实际邮件的邮件正文

Php 显示HTML标记而不是实际邮件的邮件正文,php,Php,代码正在为gmail、yahoo工作,但对于公司ID,它显示的是HTML标记,而不是实际的消息。。像下面这样的东西 Content-type: text/xhtml; charset=iso-8859-1 From: info@test.net X-Mailer: php Message-Id: <20130424005039.50FF769A98@test.=myweb.org> Date: Wed, 24 Apr 2013 05:50:39 -0500 (CDT) 内容类型

代码正在为gmail、yahoo工作,但对于公司ID,它显示的是HTML标记,而不是实际的消息。。像下面这样的东西

Content-type: text/xhtml; charset=iso-8859-1

From: info@test.net

X-Mailer: php
Message-Id: <20130424005039.50FF769A98@test.=myweb.org>
Date: Wed, 24 Apr 2013 05:50:39 -0500 (CDT)
内容类型:text/xhtml;字符集=iso-8859-1
发件人:info@test.net
X-Mailer:php
消息Id:
日期:2013年4月24日星期三05:50:39-0500(CDT)
  • 当代码在客户端pc中提交时,当我们使用除公司id之外的其他id时,代码工作正常,唯一的问题是公司id
  • 如果邮件从其他主机(php)发送到公司id,html同样显示良好。我不知道我现在该怎么办
  • 来自php.net代码的片段。
    $to .= 'mytomailid@mail.com';
    
    // subject
    $subject = 'Birthday Reminders for August';
    // message
    $message = '
    <html>
    <head>
      <title>Birthday Reminders for August</title>
    </head>
    <body>
      <p>Here are the birthdays upcoming in August!</p>
      <table>
        <tr>
          <th>Person</th><th>Day</th><th>Month</th><th>Year</th>
        </tr>
        <tr>
          <td>Joe</td><td>3rd</td><td>August</td><td>1970</td>
        </tr>
        <tr>
          <td>Sally</td><td>17th</td><td>August</td><td>1973</td>
        </tr>
      </table>
    </body>
    </html>
    ';
    
    // To send HTML mail, the Content-type header must be set
    $headers  = 'MIME-Version: 1.0' . "\r\n";
    $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
    
    // Additional headers
    $headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
    $headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
    $headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
    $headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
    ?>
    
    $to.='mytomailid@mail.com';
    //主题
    $subject=‘八月生日提醒’;
    //信息
    $message='1
    八月生日提醒
    这里是八月即将到来的生日

    人月耳 1970年8月3日 萨勒17塔古斯特1973 '; //要发送HTML邮件,必须设置内容类型标题 $headers='MIME版本:1.0'。“\r\n”; $headers.='内容类型:文本/html;字符集=iso-8859-1'。“\r\n”; //附加标题 $headers.='To:Mary,Kelly'。“\r\n”; $headers.=“发件人:生日提醒”。“\r\n”; $headers.='Cc:birthdayarchive@example.com' . “\r\n”; $headers.='密件抄送:birthdaycheck@example.com' . “\r\n”; ?>
    您应该尝试使用库发送邮件。它处理这种类型的头条件