邮件发送成功但未使用codeigniter邮件smpt接收

时间:2017-12-20 19:02:05

标签: php email codeigniter-3

我正在使用codeinter电子邮件发送邮件。邮件已成功发送但未收到。

这是我的代码:

function send_verify_email($email)
{
    $email_code = md5($email);

    $config = Array(
        'protocol' => 'smtp',
        'smtp_crypto'=> 'ssl',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 587,
        'smtp_user' => 'test@gmil.com', // change it to yours
        'smtp_pass' => '***', // change it to yours
        'mailtype' => 'html',
        'charset' => 'iso-8859-1',
        'wordwrap' => TRUE
    );

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

    $this->email->set_newline("\r\n");
    // $this->email->set_mailtype("html");
    $this->email->from('test@gmail.com', "TalentRiser Update Password");
    $this->email->to('receiver@gmail.com');
    $this->email->subject("Update Password");                  
    $this->email->message('hello for test');
    if($this->email->send())
    {
        echo "success";
    }
    else
    {
        echo "Failed";
    }
}

0 个答案:

没有答案