0

すべてのクライアントにプロモーション メールを送信したいと考えています。すべてのメーリングリストを含むtxtファイルがあります。

ベローは電子メールを送信するための私のコードですが、このコードは時々しか機能せず、時には機能しません。

テキスト ファイルのサンプル:

abc@abc.com
xyz@xyz.com
hello@xyz.com

等々。

このファイルはルート ディレクトリに格納されます。

今私のコントローラのコード。

$file = fopen("10.txt", "r");
$str = "";
$i = 0;
while (!feof($file)) {
  if($i != 0){ $str .= ","; }else{ $i++;}
  $str .= fgets($file);
}
fclose($file);
$this->load->library('email');
$this->email->clear(TRUE);
$this->email->from('email-id@email.com', 'Name Here');
$this->email->to('email-id@email.com'); 
$this->email->bcc($str); 
$this->email->set_mailtype("html");
$this->email->subject('Subject here');
$message = $this->load->view('email-template', '' , true);  
$this->email->message($message);    
$this->email->send();

この問題を解決するのを手伝ってもらえますか?

4

0 に答える 0