简体   繁体   English

使用Pear(PHP)发送HTML电子邮件时出错

[英]Error sending html email using Pear (PHP)

I am using pear to send SMTP mail with HTML format, everything was fine, but in the last report you make, the report goes wrong formatted and the reason is because the HTML adds an exclamation mark (!) In random parts and when it falls by means of a label or style moves everything. 我正在使用pear发送HTML格式的SMTP邮件,一切都很好,但是在您上次制作的报告中,报告格式错误,原因是因为HTML在随机部分以及当它落下时添加了感叹号(!)。通过标签或样式移动所有内容。 If someone can give me a hand. 如果有人可以帮我。

function sendEmail($parameters) {
require_once "Mail.php";
print_r($parameters['emailBody']);
$from = "XXXXXXXXXX";
$to = $parameters['emailAddress'];
$subject = $parameters['reportName'];

$host = "XXXXXX";
$port = "XXXX";

$headers = array('From' => $from,
    'To' => $to,
    'Subject' => $subject,
    'Content-type' => 'text/html; charset=utf8');
$smtp = Mail::factory('smtp', array('host' => $host,
            'port' => $port,
            'auth' => false));

$mail = $smtp->send($to, $headers, $parameters['emailBody']);

} }

<td>!</td>

Well after searching a bit, I found that HTML was not formatted, missing lines changes and apparently when this all in one line, is poorly formatted and interpreted otherwise. 经过一番搜索,我发现HTML没有格式化,缺少的行发生了变化,显然当所有这些都在一行中时,格式化和解释不当。

Thanks for your time. 谢谢你的时间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM