1

我正在使用CodeIgniter的内置库发送一封电子邮件。我要做的就是发送一个粗体字符串,但不是渲染标签,而是打印它们。我有的:

<html>
 <head>
 </head>
 <body>
 <b>Donkey</b>
 </body>
 </html>

也就是说,一个字一个字,我收到的电子邮件。为什么标签不呈现?

4

2 回答 2

5

文档中:

$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';

$this->email->initialize($config);

CodeIgniter Email 类默认发送文本电子邮件。除非您指定邮件类型为 HTML ( $config['mailtype'] = 'html';),否则您的 html 将作为文本发送出去。

于 2010-05-17T18:18:20.203 回答
0

你有没有尝试过

<span style='font-weight: bold'>My bold text</span>

或者

<strong>another bold tag</strong>

?

我们使用这些,它们都适用于 Gmail。

于 2010-05-17T18:16:48.970 回答