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." <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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.