1

有没有办法在 codeigniter 上包含 sendgrid 模板?

我正在使用 codeigniter 提供的代码。

$this->load->library('email');

$this->email->initialize(array(
  'protocol' => 'smtp',
  'smtp_host' => 'smtp.sendgrid.net',
  'smtp_user' => 'sendgridusername',
  'smtp_pass' => 'sendgridpassword',
  'smtp_port' => 587,
  'crlf' => "\r\n",
  'newline' => "\r\n"
));

$this->email->from('your@example.com', 'Your Name');
$this->email->to('someoneexampexample@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();

echo $this->email->print_debugger();

我需要为消息内容使用 html 模板。我试图添加

  $this->email->message('<html><head></head>
<body>My Content</body.
</html>');

但是在收到的电子邮件中,它显示了完整的 html 脚本

有什么帮助吗?谢谢

4

0 回答 0