Codeigniter send email with attach file

前端 未结 8 1554
走了就别回头了
走了就别回头了 2020-11-30 05:15

I am trying to send email on codeigniter with attach file.

I always receive email successfully. However , I never receive with attach file. Below is code and highly

8条回答
  •  生来不讨喜
    2020-11-30 05:45

         'smtp',
              'smpt_host' => 'ssl://googlemail.com',
              'smtp_port' => 465,
              'smtp_user' => 'example@gmail.com',
              'smtp_pass' => 'yourpass'
               );
     $this->load->library('email', $config);
     $this->email->set_newline("\r\n");
    
     $this->email->from('example@gmail.com');
     $this->email->to('example@gmail.com');
     $this->email->subject('This is a test email sending');
     $this->email->message('This is some message, you can type your own');
    
     if($this->email->send()
    {
        echo "Your email has been sent";
    }else{
       show_error($this->email->print_debugger());
    }
    
    }
    
    
     ?>
    

提交回复
热议问题