如何在 laravel 中使用 Mailgun 发送多封电子邮件?
How to send multiple emails using Mailgun in laravel?
我试过这段代码:
$message->to(array(
'bb@gmail.com',
'zz@gmail.com'
));
$message->from('foo@example.com', 'Recipient Name');
$message->subject('Welcome!');
我收到错误:
The parameters passed to the API were invalid. Check your inputs!
Sandbox subdomains are for test purposes only. Please add your own
domain or add the address to authorized recipients in domain settings.
试试下面的代码
$receivers = ['bb@gmail.com', 'zz@gmail.com'];
Mail::send('your_theme', [], function($message) use ($receivers)
{
$message->to($receivers)->subject('Welcome!');
});
var_dump( Mail:: failures());
exit;
这适用于我的 laravel 4.2,不确定以后的版本。
资料来源:Laravel Mail::send() sending to multiple to or bcc addresses
我试过这段代码:
$message->to(array(
'bb@gmail.com',
'zz@gmail.com'
));
$message->from('foo@example.com', 'Recipient Name');
$message->subject('Welcome!');
我收到错误:
The parameters passed to the API were invalid. Check your inputs! Sandbox subdomains are for test purposes only. Please add your own domain or add the address to authorized recipients in domain settings.
试试下面的代码
$receivers = ['bb@gmail.com', 'zz@gmail.com'];
Mail::send('your_theme', [], function($message) use ($receivers)
{
$message->to($receivers)->subject('Welcome!');
});
var_dump( Mail:: failures());
exit;
这适用于我的 laravel 4.2,不确定以后的版本。 资料来源:Laravel Mail::send() sending to multiple to or bcc addresses