Hi!
Ok, is there a way to use the mail function to send the body of the mail to emails stored in a user table?
So the method:
1. select the email accounts from the user table and put them in an array
2. use the mail() function and select all the email accounts from the sql array
3. submit the mail so it will be sent to all the accounts from the table.
Greetings,
thiscatis
[PHP mail] Send mail to multiple users at once
Moderator: General Moderators
Yes.
Depending on the amount of e-mails, just loop through it (for or foreach).
If you're constantly doing hundreds and even thousands, you might consider breaking down the loop into sections of 100-150. Or there is also sending mail via sockets, which is a much more complex process than looping the mail() function.
Depending on the amount of e-mails, just loop through it (for or foreach).
If you're constantly doing hundreds and even thousands, you might consider breaking down the loop into sections of 100-150. Or there is also sending mail via sockets, which is a much more complex process than looping the mail() function.
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
For something like that I'd consider using a library like Swift.