3
我最近注册了SendGrid并查看了他们与CodeIgniter的集成。使用sendgrid和codeigniter向多个收件人发送邮件
他们建议做以下发送邮件了:
$this->email->initialize(array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.sendgrid.net',
'smtp_user' => 'sendgridusername',
'smtp_pass' => 'sendgridpassword',
'smtp_port' => 587,
'crlf' => "\r\n",
'newline' => "\r\n"
));
$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
这似乎是向用户发送电子邮件,以单个人,而是什么一个很好的解决方案,如果我有,我要发送到一大堆的电子邮件的人?是否有可能以数组形式发送“to”或“bcc”?
是否有一种不同的集成方法首选使用SendGrid与CI?
谢谢!
也改为@ air4x答案,文档是你最好的朋友:) http://codeigniter.com/user_guide/libraries/email.html –