Page 1 of 1

Problems with mail and WIN2K

Posted: Wed May 07, 2003 6:29 pm
by lloydie-t
I am having desperate problems trying to use the mail function on a WIN2K box. The ODD thing is that the scripts work fine on the ISP *NIX boxes.
I have already set the PHP.INI file so that SMTP is using my ISP server and sendmail_from is set with a valid email address. I have also telneted to the SMTP server from the WIN2K box to check that it is working.
The problem I have is that PHP hangs and I have to close all browser windows using it before i can get back in.

Here is the simple script I am trying to get to work.

Code: Select all

$myname = "Touch Support"; 
$myemail = "lloyd@touch.com"; 

$contactname = "Lloyd T"; 
$contactemail = "lloydie-t@plus.com"; 

$message = "hello from  me"; 
$subject = "test from lloyd"; 

$headers .= "MIME-Version: 1.0\r\n"; 
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; 
$headers .= "From: ".$myname." <".$myemail.">\r\n"; 
$headers .= "To: ".$contactname." <".$contactemail.">\r\n"; 
$headers .= "Reply-To: ".$myname." <$myreplyemail>\r\n"; 
$headers .= "X-Priority: 1\r\n"; 
$headers .= "X-MSMail-Priority: High\r\n"; 
$headers .= "X-Mailer: Just My Server"; 

mail($contactemail, $subject, $message, $headers);
Any Ideas
-------------------------------------------------
WIN2K
PHP 4.3.1
Apache 1.27
MySQL 4.0.4

Posted: Thu May 08, 2003 2:53 am
by volka
maybe your isp requires some kind of authentication before using the smtp-server. I had trouble with my domain provider's smtp, too. But after finding that they support smtp-after-pop3 I gave up efforts to extend the mail module of php (digest implementation is not for me ;) )

Posted: Thu May 08, 2003 4:18 am
by twigletmac
Have you tried a simple test of the mail() function, something like:

Code: Select all

$to = 'me@mydomain.com';
$subject = 'mail() test';
$msg = 'testing';

mail($to, $subject, $msg);
Mac

Posted: Thu May 08, 2003 4:23 am
by lloydie-t
It seems PHP does not like the ISP SMTP setting. I have installed a SMTP mail server and now use localhost for sending mail. All seems OK so far except that my my main mail() script is not sending even though it is connecting to SMTP. Will have to investigate more, but for this particular problem mail is now working with a local SMTP server.

Thanx