嗨朋友,我在codeigniter创建新闻通讯.有没有办法用CI电子邮件库发送多个电子邮件或我应该使用第三方?
Ros*_*oss 11
使用电子邮件类,类似于:
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();
}
Run Code Online (Sandbox Code Playgroud)
会工作.(直接来自文档).这取决于您拥有多少个地址,以及服务器/邮件队列处理/脚本超时等任何限制
我个人并不知道第三方CI新闻简报插件/库,但我看起来并不太难.
直接从手册...
$this->email->to()
Run Code Online (Sandbox Code Playgroud)
设置收件人的电子邮件地址。可以是单个电子邮件、逗号分隔的列表或数组:
$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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
18445 次 |
| 最近记录: |