how to use mail() script without writing the sender email address

Started by fy166, August 19, 2003, 07:00:31 AM

Previous topic - Next topic

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.
PHPNews has been released! Download it now!

Read My Blog!

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 protected], [email protected], 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.
Find out about Enigma, the portal built exclusively for YaBB SE will be continuing it's work towards SMF

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.
Find out about Enigma, the portal built exclusively for YaBB SE will be continuing it's work towards SMF

Wezz6400

What I mean is that if I send an e-mail with lot's of addresses in the BCC field with some hotmail addresses among them and in the to field I fill in one other address (you're right there needs to be valid one) then the e-mail is going to the junkmail folder of the hotmail users. My guess is that that is because in the to field the address of the receiver is not listed.

I agree with you that hotmail stinks by the way, I just use it for sites where I need to fill in an e-mailaddress but I don't care what is send to that address.

Haase

Quote from: Wezz6400 on August 22, 2003, 06:33:53 PM
I agree with you that hotmail stinks by the way, I just use it for sites where I need to fill in an e-mailaddress but I don't care what is send to that address.

exactly...  what's beautiful about hotmail is that if you don't use your account in a specified amount of time, they deactivate it and then delete all your messages.  So you never have to worry about cleaning it out.  Just activate it every time you need to register something you don't really care about, then forget about it until you need it again.   ;D
Find out about Enigma, the portal built exclusively for YaBB SE will be continuing it's work towards SMF

Advertisement: