Forum Moderators: coopster

Message Too Old, No Replies

mail() hanging after Windows Reinstall

         

ukgimp

12:11 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I use phpdev to have mysql, php etc on my windows machine. I have set the php.ini to the correct mail server as I had before.

Now the script runs but hangs and then times out. The mail is sent OK, but the mail part is integral to my testing.

Got any ideas?

Cheers

coopster

3:22 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



No.

I'm running into a similar issue on a test box:

Apache 2.0.48 (Win32) binary
PHP/5.0.0b4 installed as module
SMTP mail.myisp.net (The MTA is a remote machine)

I'm not running an SMTP server locally. The message is sent, but the script stops running...and I am confused.

What does your setup look like?

ukgimp

3:33 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



coop

this is well weird.

I am running the same package from firepages. All that has changed is my OS. From Win 2000 to XP pro.

Every other script is quick and fast.

Do you reckon it could be due to incorrect headers? Here are mine:

$to = "the@emailaddress.com";

$subject ="The Mail Subject";

$message = "The message";

$headers .= "From: Somebody<abc@server.com>\n";
$headers .= "X-Sender: <def@server.com>\n";
$headers .= "X-Mailer: PHP\n"; //mailer
$headers .= "X-Priority: 3\n"; //1 UrgentMessage, 3 Normal
$headers .= "Return-Path: <mail@server.com>\n";
// Uncomment this to send html format
//$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
// $headers .= "cc: [email]some@address.com[/email]\n"; // CC to
// $headers .= "bcc: [email]mail@server.com[/email]"; // BCCs to, separete multiple with commas [email]mail@mail.com[/email], [email]mail2@mail.com[/email]

$send = mail($to,$subject,$message,$headers);
echo $send;

bcolflesh

3:34 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



PHP/5.0.0b4 installed as module

What happens if you switch to CGI? There are some posts at:

bugs.php.net

that report mail problems with ASAPI that were fixed by switching to CGI.

coopster

3:56 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I'm not sending any addtional headers, just a simple test:
$to = 'me@mycompany.com'; 
$subject = 'test';
$message = 'test';
mail($to, $subject, $message);
print 'Message sent';

The script runs sometimes within seconds, sometimes minutes. It will always send the message, and then displays a blank page, no 'Message sent' printed to the browser. It just seems to halt processing.

No, I haven't tried CGI. I already searched the bugs since it is a beta version but came up empty. Where did you find that report, bcolflesh? Could you post or sticky-mail the link?

coopster

4:43 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



bcolflesh, thanks for the links you stickymailed. They were for PHP 4 and fixed in CVS. I searched and sorted on version 5 so I didn't see those bugs. I assume that if the bugs were fixed in version 4, the same fixes would be applied to 5...? Hopefully my assumption is correct!

OK, now it gets interesting. I was stopping and restarting Apache, but that did nothing. So I reboot the pc and we're back in business. Stupid Windows.

ukgimp, bcolflesh brought up another issue in the stickymail and that is the fact that your external server may be burdened with workload because of the fresh viruses backing things up (netsky and mydoom). It may be that the external server is not responding and causing your script to time out or hang. He has a valid consideration.

ukgimp

4:52 pm on Feb 26, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK

Sounds plausable. I will wait it out and try again.

Cheers