Jump to content

[SOLVED] PHP Send Mail error on Mass Mail application


TecTao

Recommended Posts

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." <[email protected]>"."\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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.