本文介绍了如何在cakephp中一次发送多封电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要一次发送多封电子邮件,可以有任何一个例子吗?或任何想法?
我需要一次向所有网站用户发送邮件(邮件内容全部相同)
I need to send multiple emails at a time, can any one have example? or any idea ?I need to send mail to all my site users at a time (Mail content is same for all)
目前我在for循环中使用以下代码
Currently i using following code in a for loop
$this->Email->from = '<[email protected]>';
$this->Email->to = $email;
$this->Email->subject = $subject ;
$this->Email->sendAs = 'html';
推荐答案
在Cakephp 2.0中, p>
In Cakephp 2.0 I used the following code:
$result = $email->template($template, 'default')
->emailFormat('html')
->to(array('[email protected]', '[email protected]', '[email protected]')))
->from($from_email)
->subject($subject)
->viewVars($data);
这篇关于如何在cakephp中一次发送多封电子邮件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!