Php 发送电子邮件类型

Php 发送电子邮件类型,php,html,codeigniter,Php,Html,Codeigniter,这是我的发送电子邮件功能,它可以发送电子邮件,但是我有两种不同类型的电子邮件(txt、html)。问题是,当它发送到我的雅虎地址时,它会发送html,这很好,但它会显示html代码,而不是呈现它。我怎样才能解决这个问题 /** * Send email message of given type (activate, forgot_password, etc.) * * @param string * @param string * @param array

这是我的发送电子邮件功能,它可以发送电子邮件,但是我有两种不同类型的电子邮件(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();
}

请尝试使用PHPMailer,它功能强大且完整。

是否将邮件类型设置为html?邮件正文是完整的网页吗?你读过了吗:我忘了创建自己的配置文件。我这样做了,现在它可以工作了。@user1406861:请发布您的解决方案并将其标记为已接受,以方便将来的访问者