TecTao Posted July 10, 2008 Share Posted July 10, 2008 I inherited a mass email script for a clients application. It has worked fine but recently the client decided to move his hosting from a less reputable firm to GoDaddy. All of the applications through the site work fine except a mass mail script. The script works fine for a single test email entry but when adding one or more emails from a list the following error occures: Warning: mail():Bad parameters to mail() function, mail not sent. in /home/content/i/html/admin/t_msg.php on line 63 The portion of the t_msg.php script pertaining to the mass mail is: (Script starts on line 52) if ($tsend == "Send"){ $handle = fopen($mailfiles."Address.txt", "rt"); if ($handle) { while (!feof($handle)) { $to = fgets($handle, 4096); $headers = "MIME-Version: 1.0"."\n"; $headers.= "Content-type: text/html; charset=iso-8859-1"."\n"; $headers.= "From: ".$from." <info@testsite.com>"."\r\n"; (this starts script line 63) if (mail($to, $subject, $message, $headers)){ //**write email address into sent file $action = date("Y/m/d,".(date('H')).":i:s", mktime()) . ",".$to."\n"; $fd = fopen($mailfiles."Sent.txt", "a"); fwrite($fd, $action); fclose($fd); } } fclose($handle); } The $mailfiles variable comes from a config.php file called from an include at the beginning of the t_msg.php page. It is the path to the mail folder containing the Address.txt file. Are there any thoughts or recommendations? Thanks... Mike 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.