I need to use the PHP mail() function in order to send an email to a number of individuals.
So lets say that I have 5 users that need to get a particular email. I was thinking that the correct way of going about using the mail() function, would be:
1) to create an array variable
2) load the 5 usernames in the array
3) then store in a variable the size of the array, i.e. in my example it is 5 positions.
4) make a for loop with its limit whatever the array size is...
5) for each iteration read the corresponding username from the array and use the mail() function to email that specific username...
The point is, does anyone know of any other function other than mail() that can take more than one recipients? That would be really helpful and actually it would be more optimal and save server time... I created a massml() function myself and it takes as recipient an array argument, it works with the specifications that I gave above. But I am using a loop inside my function so this is still the same as looping the mail() function... It's not much of a problem but the optimality of this has been bugging me since morning.
Thanks for listening, I appreciate any answers,