-1

这是我发送电子邮件的发送电子邮件功能,但是我有两种不同类型的电子邮件(txt、html)。问题是,当它发送到我的雅虎地址时,它发送的 html 很好,但它显示的是 html 代码而不是渲染它。我该如何解决。

/**
* Send email message of given type (activate, forgot_password, etc.)
*
* @param       string
* @param       string
* @param       array
* @return      void
*/
function sendEmail($template, $type, $subject, $userData)
{
    $this->ci->load->library('email');
    $this->ci->email->from('kowmanagement@kansasoutlawwrestling.com', 'Kansas Outlaw Wrestling');
    $this->ci->email->reply_to('kowmanagement@kansasoutlawwrestling.com', 'Kansas Outlaw Wrestling');
    $this->ci->email->to($userData['email']);
    $this->ci->email->subject($subject);
    $this->ci->email->message($this->ci->load->view($template .'/email/'.$type.'-html', $userData, TRUE));
    $this->ci->email->set_alt_message($this->ci->load->view($template .'/email/'.$type.'-txt', $userData, TRUE));
    $this->ci->email->send();
}
4

1 回答 1

-1

试试PHPMailer,它功能强大且完整。

于 2012-05-21T01:30:33.817 回答