aaronlzw_21 Posted January 27, 2010 Share Posted January 27, 2010 Hi i created a script to mass mail my clients via bcc field. whenever i sent, i will encounter a 500 internal server error, but the mail is stil sent. in the bcc field have about 50 addressees. I tried sending 15 addresses at a time it will still give me the same error. Below are my codes. Any idea what's wrong? $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $headers .= "From: Mass_Email@xxxxxxxxxx.com\r\nReply-To: ". $_SESSION["email"]."\r\n"; $headers .= "Bcc: " .$recipients; mail("", $subject, $message, $headers); Quote Link to comment Share on other sites More sharing options...
teamatomic Posted January 27, 2010 Share Posted January 27, 2010 Put your email address in the to slot of the mail function. See if you still get the 500. HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
aaronlzw_21 Posted January 28, 2010 Author Share Posted January 28, 2010 You mean into the first parameter of mail? but that would be in the TO list. I need it to be in the BCC list.. Quote Link to comment Share on other sites More sharing options...
teamatomic Posted January 28, 2010 Share Posted January 28, 2010 And they both cant have a value? And the to and BCC dont/wont work together? HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
aaronlzw_21 Posted January 28, 2010 Author Share Posted January 28, 2010 And they both cant have a value? And the to and BCC dont/wont work together? HTH Teamatomic What do you mean? Quote Link to comment Share on other sites More sharing options...
aaronlzw_21 Posted January 28, 2010 Author Share Posted January 28, 2010 i mean if i insert the $recipients into the first parameter in the mail function. would the recipients be in the TO field of the email or BCC? as i need it to be in the BCC field. Quote Link to comment Share on other sites More sharing options...
teamatomic Posted January 28, 2010 Share Posted January 28, 2010 Not the recipients list, just ~your~ email address, just so it has a value. Put it to a blackhole if you dont want 500 messages. Put Brobamas in there. Just as long as it has a valid value. See if the script works then. If it does then just use a blackhole address. Just an idea cause BCC is Blind Carbon Copy. How can you have a carbon copy with no original? Just a maybe why. HTH Teamatomic Quote Link to comment Share on other sites More sharing options...
aaronlzw_21 Posted January 28, 2010 Author Share Posted January 28, 2010 ic i get what you mean. ok i'll try it first THANKS! Quote Link to comment Share on other sites More sharing options...
aaronlzw_21 Posted February 1, 2010 Author Share Posted February 1, 2010 ic i get what you mean. ok i'll try it first THANKS! I have tried but it still shows the same error. I did a test, some email are "dead" does it affect this problem? it does, anyway to catch this exception? On the server log, the error was stated "Premature end ofscript headers". My server is running on php4. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.