PDA

View Full Version : open in new windowScript stopped sending emails / Please help


smartcard
04-28-2007, 05:10 PM
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"));
}

iLLin
04-29-2007, 03:42 PM
Has it worked before? I have you verified your server is setup right, by sending email through the command line? Are yo using SMTP? Have you verified that works? Have you verified the mail() function works? Are you even using that?

Troubleshooting at its finest :)

smartcard
04-29-2007, 04:49 PM
How can I send a test email through the command line?
How can I send a test email through the PHP script?

iLLin
04-29-2007, 05:52 PM
How can I search with google?