In my controller there is a code for sending email to one recipient, But I want to send mail to multiple recipients. Not use cc,bcc or direct assignment. I want to enter comma separated mail ids through the front end
how to take each mail id in comma separated 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>