codeigniter localhost email not sending

后端 未结 2 904
轻奢々
轻奢々 2021-01-16 08:33

I have some problem and I don\'t understand. This is my code

$this->load->library(\'email\');
$config[\'protocol\'] = \'sendmail\';
$config[\'mailpath         


        
相关标签:
2条回答
  • 2021-01-16 09:18

    In Codeigniter, Try this

    $this->load->library('email');
    $config['protocol']='smtp';
    $config['smtp_host']='your host';
    $config['smtp_port']='465';
    $config['smtp_timeout']='30';
    $config['smtp_user']='your mail id';
    $config['smtp_pass']='your password';
    $config['charset']='utf-8';
    $config['newline']="\r\n";
    $config['wordwrap'] = TRUE;
    $config['mailtype'] = 'html';
    $this->email->initialize($config);
    $this->email->from('no-reply@your-site.com', 'Site name');
    $this->email->to('to-address-mail-id');
    $this->email->subject('Notification Mail');
    $this->email->message('Your message');
    $this->email->send();
    

    In $config['smtp_user'] field,give your email_id and in $config['smtp_pass'] field,provide your password for that mail.

    This will work.Just try it. Hope this will solve your problem.

    0 讨论(0)
  • 2021-01-16 09:18

    You can find your solution from these two links How to configure XAMPP to send mail from localhost?

    http://thephpcode.blogspot.com/2009/03/setting-up-local-mail-smtp-pop3-imap.html

    0 讨论(0)
提交回复
热议问题