使用CI电子邮件库发送邮件

时间:2016-10-25 17:15:55

标签: php codeigniter email

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

    $this->email->from($_POST['email'], $_POST['name']);
    $this->email->to(CONTACT_US_MAIL1);

    $this->email->subject($_POST['subject']);
    $this->email->message($_POST['message']);

    $this->email->send();

从CI发送邮件时出错

mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()

0 个答案:

没有答案