php - Send a mail to multiple receipients in codeigniter -


in controller there code sending email 1 receipient,but want send mail multiple receipients.not use cc,bcc or direct assignment.i want enter comma seperated mail ids through frond end

how take each mail id in comma seperated form?

controller:

public function shopshare($userid,$shopname,$shop_id) {      $from_email=$this->input->post('from_email');     $to_email=$this->input->post('to_email');     $subject_url=$this->input->post('url');     $message=$this->input->post('message');     $this->email->from($from_email);     $this->email->to($to_email);      $this->email->subject($url);     $this->email->message($message);         $this->email->send();      redirect(base_url().'shop/shopdetail/'.$shop_id.'/'.$shopname); } 

view:

<label>     <span>to:</span>     <input id="to_email" type="text" name="to_email[]" placeholder="to email address"> </label> 

anyone can give suggetion?

you can way $this->email->to('one@example.com, two@example.com, three@example.com');

you can pass array of email addresses like

$list = array('one@example.com', 'two@example.com', 'three@example.com');   $this->email->to($list); 

Comments

Popular posts from this blog

qt - Using float or double for own QML classes -

Create Outlook appointment via C# .Net -

ios - Swift Array Resetting Itself -