Can you provide a code sample?
Jul 25, 2017
3
Level 1
Mail Sending Multiple Recipients Using ForEach
Hi,
I have a command that sends every 60 minutes e-mails to a short list with the use of Mailable, I pass some personal issues to content body of every single message. This command works perfectly and the e-mail is sent, but, just to one recipient.
This is the way:
- Query Students DB with Eloquent that returns, for example, six results;
- I do : Foreach. During the loop, I call : Mail::to($request->email)->send(new pendingStudents($info)); 3 If I print $request->email before the "Mail" - all of them appears. But just one is sent, the first one of the loop.
And there is no error.
Regards,
Level 1
Finally I have the answer!
Probably...probably relates to my mail server (hostgator). I am now sending e-mails throught AWS SES and everything worked like a charm.
Please or to participate in this conversation.