Hi,
Have you tried smtp = 127.0.0.1 in php.ini ? I looks like PHP can't
even connect to the smtp service.
Jan Svoboda
Odesláno z iPhone
4.11.2009 v 0:53, Richard Quadling <rquadling@xxxxxxxxxxxxxx>:
2009/11/3 dot net noob <noob@xxxxxxxxx>:
On Tue, 03 Nov 2009 22:19:53 GMT Niel Archer <not@xxxxxxxxxx> wrote
Hi All: Just joined the list.
I'm having problems configuring mail in PHP. I have PHP 5.2.9
installed on
server 2003 std with sp2 installed. The default SMTP service is
running.
I'm running Wordpress without any problems, except for
configuring mail.
My php.ini file looks like:
[mail function]
; For Win32 only.
;smtp = localhost
;smtp = 127.0.0.1
smtp = 192.168.1.6
smtp_port = 25
; For Win32 only.
sendmail_from = me@xxxxxxxxxxxx
I've tried each of the three server addresses above, and none of
them work.
If I try to run a simple test like:
<?php
$to = "me@xxxxxxxxxxxx";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "me@xxxxxxxxxxxx";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";
?>
$headers must be terminated by "\r\n"
Thanks Neil...I went back to the php.net docs for "mail" and picked
up their
example, with this syntax:
<?php
$to = 'you@xxxxxxx';
$subject = 'Test mail';
$message = 'hello';
$headers = 'From: me@xxxxxx' . "\r\n" .
'Reply-To: wme@xxxxxx' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
(I've replaced the actual "to" and "from" to dummy
addresses)...still doesn't
work...I don't get an error when running the script, but no mail is
sent.
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Can you telnet to port 25 on the server hosting the SMTP service?
Use something like Wireshark to watch what actually happens?
Does the mail() call return true or false?
Can you upgrade to PHP 5.30 and try setting the mail.log [1]?
Regards,
Richard.
[1] http://docs.php.net/manual/en/mail.configuration.php#ini.mail.log
--
-----
Richard Quadling
"Standing on the shoulders of some very clever giants!"
EE : http://www.experts-exchange.com/M_248814.html
Zend Certified Engineer : http://zend.com/zce.php?c=ZEND002498&r=213474731
ZOPA : http://uk.zopa.com/member/RQuadling
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php