Jump to content

Mass Email send problem with mail function


TecTao

Recommended Posts

I just moved an application to GoDaddy hosting from a previous hosting company.  One part of the application is a mass mail application.

 

The mass mail application worked fine on the other server.  It won't send out on the new server.  The error message received is

 

Warning: mail():Bad parameters to mail() function, mail not sent. in /home/.../t_msg.php on line 63

 

I took the script and copied it to a third server, not GoDaddy.  The mass mail works fine.

 

I talked to the level 1 tech people at GD, they gave me the sendmail path as well as the server for emails "relay-hosting.secureserver.net.  Nowhere in the mass mail script does it reference the send mail path or a seperate server.

 

Does anyone have any suggestions on what might be going on here, why it works on my server, the clients old server but not on the new GoDaddy server.

 

Thanks for any help.

Thanks for the input, here's the mail () function.  The if ($tsend == "Send") deals with the part of the previous form that sent the variables, there is a test function that works fine.

 

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

 

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);

}

I copied and pasted your code. When I did, I got a Unexpected $end.

 

I fixed that by closing out the while loop. Once I did that it worked fine. Try this and lemme know what you get.

 

<?php
$tsend = 'Send';
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";
	  
	  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);

		 echo 'Mail Sent';
	  }
   }
      fclose($handle);
}

}
?>

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.