Forum Moderators: coopster

Message Too Old, No Replies

Script stopped sending emails / Please help

         

smartcard

4:04 pm on Apr 28, 2007 (gmt 0)

10+ Year Member



Following is the function in my PHP script to send the emails. My current PHP version is 4.4.6 when ever I tried to send a email I am getting the "Error: it was not possible to send e-mail message"

Please help....

Function SendMail($to,$subject,&$body,&$headers)
{
$return_path="";
if(IsSet($this->delivery["Headers"]))
{
$headers_values=$this->delivery["Headers"];
for($header=0,Reset($headers_values);$header<count($headers_values);$header++,Next($headers_values))
{
if(strtolower(Key($headers_values))=="return-path")
{
$return_path=$headers_values[Key($headers_values)];
break;
}
}
if(strlen($return_path))
{
if(!defined("PHP_OS"))
return($this->OutputError("it is not possible to set the Return-Path header with your PHP version"));
if(!strcmp(substr(PHP_OS,0,3),"WIN"))
return($this->OutputError("it is not possible to set the Return-Path header directly from a PHP script on Windows"));
if($this->GetPHPVersion()<4000005)
return($this->OutputError("it is not possible to set the Return-Path header in PHP version older than 4.0.5"));
}
}
$success=(strlen($return_path)? mail($to,$subject,$body,$headers,"-f".$return_path) : mail($to,$subject,$body,$headers));
return($success? "" : $this->OutputError("it was not possible to send e-mail message"));
}

eelixduppy

12:22 am on Apr 29, 2007 (gmt 0)



>> script stopped sending emails

Does this mean that your script was working and then all of a sudden stopped? If so, have you changed anything recently? Are you getting any error messages other than the one generated by the function?

piskie

1:19 am on Apr 29, 2007 (gmt 0)

10+ Year Member



If it did work and has now stopped working, it could be due to a Server Software Upgrade. This happened to me recently on a Cpanel Server.

smartcard

3:51 pm on Apr 29, 2007 (gmt 0)

10+ Year Member



Yes, it was working perfectly for last 3 years and yesterday it stopped. I have Cpanel shared hosting account

dreamcatcher

7:01 pm on Apr 29, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Has your host imposed some restrictions on the PHP mail function? Have you tried sending a message to an e-mail address on the same domain? It could be you need to use SMTP authentication to send mail to third party addresses if they have changed things. Some hosts are doing this nowadays on account of the PHP mail function being abused.

Might be worth contacting them.

dc

coopster

1:43 pm on Apr 30, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



How many recipients? Some shared hosts also have restrictions on the number of recipients in any given message. You may have to create a loop to send them out in batches as opposed to one lump send mail operation.