$ this- >电子邮件-> attach()
使您可以发送附件。将文件路径/名称放在第一个参数中。注意:使用文件路径,而不是URL。对于多个附件,请多次使用该功能。例如:
public function setemail(){$email="xyz@gmail.com";$subject="some text";$message="some text";$this->sendEmail($email,$subject,$message);}public function sendEmail($email,$subject,$message) { $config = Array( 'protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.googlemail.com', 'smtp_port' => 465, 'smtp_user' => 'abc@gmail.com', 'smtp_pass' => 'passwrd', 'mailtype' => 'html', 'charset' => 'iso-8859-1', 'wordwrap' => TRUE ); $this->load->library('email', $config); $this->email->set_newline("rn"); $this->email->from('abc@gmail.com'); $this->email->to($email); $this->email->subject($subject); $this->email->message($message); $this->email->attach('C:UsersxyzDesktopimagesabc.png'); if($this->email->send()) { echo 'Email send.'; } else { show_error($this->email->print_debugger()); } }
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)