【问题标题】:Sending multiple email from codeigniter从 codeigniter 发送多封电子邮件
【发布时间】:2010-10-08 08:06:22
【问题描述】:

嗨,朋友们,我正在使用 codeigniter 创建时事通讯。有没有办法使用 CI 电子邮件库发送多封电子邮件,还是应该使用第三方?

【问题讨论】:

    标签: codeigniter


    【解决方案1】:

    直接从手册...

    $this->email->to() 
    

    设置收件人的电子邮件地址。可以是单个电子邮件、逗号分隔的列表或数组:

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

    【讨论】:

      【解决方案2】:

      使用电子邮件类,例如:

      foreach ($list as $name => $address)
      {
          $this->email->clear();
      
          $this->email->to($address);
          $this->email->from('your@example.com');
          $this->email->subject('Here is your info '.$name);
          $this->email->message('Hi '.$name.' Here is the info you requested.');
          $this->email->send();
      }
      

      会起作用的。 (直接来自文档)。这取决于您拥有多少个地址,以及任何限制,例如服务器/邮件队列处理/脚本超时等

      我个人不知道第 3 方 CI 时事通讯插件/库,但我没有仔细研究。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2011-02-08
        • 2014-06-17
        • 2016-07-17
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多