send simple email using codeigniter

前端 未结 1 1974
挽巷
挽巷 2021-01-28 08:18

I am trying to send simple email using codeigniter as explain this link codeigniter email class ,but it doesn\'t work. This is my form :

相关标签:
1条回答
  • 2021-01-28 08:59

    Try the below code.

    $email_config = Array(
                 'protocol'  => 'smtp',
                 'smtp_host' => 'bh-24.webhostbox.net',
                 'smtp_port' => '465',
                 'smtp_user' => 'feedback@domain.com',
                 'smtp_pass' => '12feedback34',
                 'mailtype'  => 'html',
                 'starttls'  => true,
                 'newline'   => "\r\n"
                 );
                    $this->load->library('email', $email_config);
                    $this->email->from($to, 'FEEDBACK');
                    $this->email->to('feedback@domain.com');
                    $this->email->subject($sub);
                    $this->email->message($msg);
                    $this->email->send();
    
    0 讨论(0)
提交回复
热议问题