General Community > Scripting Help
how to use mail() script without writing the sender email address
fy166:
i am writing a script using mail()
and i use it to mail my members(about 2000ppls)
i don't want the member know the email addresses each other in the mail
how to do that??
Big P:
I'd take it you'd be using a while() loop or a for loop(), but I'm sure that's not the best for your server, and god knows how long it'll take.
Haase:
Although the forum (at least YaBB SE) has the sendmail() function setup so that the fourth parameter contains the "from" field, this parameter is actually reserved for ALL additional headers. You should be able to include "Bcc: email@email.com, email2@email.com, etc." in this fourth parameter.
It may take some tweaking, but it *will* work. Consult the php manual for more information and some examples.
You should also note that your mail server will probably choke if the To: field is empty... even if you have 2000 ppl in the BCC list. You can just include the site admin email in the To: field.
Also, with 2000ppl, there is a very high probability that your server is going to timeout before the script has completed sending all the emails. You should think about a way to either send them in batches, or set a rediculously long server timeout.
Wezz6400:
The problem is that some junkmailfilters filter all e-mails which don't have the correct e-mailaddress in the to filter. If I remember correctly the hotmail filter does so and I think many more do because it's a quite way to filter out junkmail.
However I don't suppost you want your e-mail to go into the junkmailfolder. Now that I think of it, in the message I got about the upcoming YaBB SE chat session july 15th my e-mailaddress was the only one in the to field. Maybe somebody can explain how this was done?
Haase:
It depends on where the email is coming from in the site. Some mail functions actually loop through the email, changing the address each time. Others collect all the email addresses and lump them together in one to: section. The problem with looping through them all individually is that when you reach a critical mass of email addresses, the server times-out before the loop completes. Some of the emails are not sent.
I'm not sure where you're getting at with the filter comment. Most mail servers won't even let you send outgoing mail unless there is a valid email in the TO: address. If Hotmail junks your messages because your address is in the CC: or BCC: field, then you need to get rid of Hotmail. I'm sorry, but CC: and BCC: are important pieces of the email standard, and are particularly critical in businesses.
Navigation
[0] Message Index
[#] Next page
Go to full version