| 8:26 pm on Sep 5, 2002 (gmt 0)|
As explained in [php.net...] you might try putting
SMTP = smtp.mailhost.tld into your php.ini.
| 8:34 pm on Sep 5, 2002 (gmt 0)|
Yes, I remember doing that back in my <shudder>Win</shudder> days. It's very easy...
| 8:50 pm on Sep 5, 2002 (gmt 0)|
I've tried putting my mail server in the php.ini file but my scripts still won't send. I know the scripts work as I have tested them on a unix server but am getting fed up with the constant uploading!
| 8:52 pm on Sep 5, 2002 (gmt 0)|
Well, great as I am, I can't guess what's wrong. Let's see the section in your ini file....
| 8:55 pm on Sep 5, 2002 (gmt 0)|
Sendmail may be configured to not relay mail from your windows box. Whatīs the error message? Perhaps itīs a matter of POP3 before SMTP.
| 8:58 pm on Sep 5, 2002 (gmt 0)|
Here it is!
; For Win32 only.
SMTP = smtp.myhost.com
I don' think this will help Nick! I think I have missed something more fundamental re. Windows/Apache and localhost.
| 9:04 pm on Sep 5, 2002 (gmt 0)|
Shouldn't make any differnece...
Have you tried putting that in quotes?
| 9:10 pm on Sep 5, 2002 (gmt 0)|
As this is a bit of a mystery to me this may sound a bit dumb! How does PHP know the path to a mail client? I see that with Unix you can set a path which makes sense. How does windows/php know how to send to the mail server?
| 9:12 pm on Sep 5, 2002 (gmt 0)|
Because of that entry in the ini file. Have you tried quoting it?
| 9:16 pm on Sep 5, 2002 (gmt 0)|
PHP doesnīt need to know the path to the MTA since it just connects to port 25 of your smtp server, which hopefully has some MTA listening on that port.
Have you tried
telnet smtp.mailhost.tld 25 to test whether there is some MTA listening? You can talk SMTP directly like this:
E:\>telnet server 25
Connected to server.
Escape character is '^]'.
220 berufsausbildung-online.de ESMTP Sendmail 8.11.6/8.11.0; Thu, 5 Sep 2002 23:
250 2.1.0 <root@localhost>... Sender ok
250 2.1.5 <af@localhost>... Recipient ok
354 Enter mail, end with "." on a line by itself
250 2.0.0 g85LHpt13781 Message accepted for delivery
221 2.0.0 berufsausbildung-online.de closing connection
Connection closed by foreign host.
If the MTA on some non-standard port you need to set that as well in your php.ini.
[edited by: andreasfriedrich at 9:20 pm (utc) on Sep. 5, 2002]
| 9:16 pm on Sep 5, 2002 (gmt 0)|
Yep, tried that but strangely I have just run phpinfo and it does not show the change to SMTP! I have saved the change to the php.ini file so surely this should be reflected in phpinfo?
| 9:19 pm on Sep 5, 2002 (gmt 0)|
I have tried telnet and there is a MTA listening. I think my problem stems from the php.ini file not updating.
| 9:21 pm on Sep 5, 2002 (gmt 0)|
If you run PHP as a module you need to restart the webserver before any effect will take place.
| 9:23 pm on Sep 5, 2002 (gmt 0)|
Beat me to it andreas!
My moneys on that ;)
| 9:31 pm on Sep 5, 2002 (gmt 0)|
Thank you both for your help. For some strange reason I can't get the SMTP setting to change. I think this is the root of the problem and I will have to dig a little deeper. I have restarted Apache to no avail.
| 9:39 pm on Sep 5, 2002 (gmt 0)|
There might be more than one php.ini on your system?
Try setting SMTP in your httpd.conf
php_value SMTP "smtp.mailhost.tld" or
ini_set('SMTP','smtp.mailhost.tld'); from within your php script.
| 9:41 pm on Sep 5, 2002 (gmt 0)|
I think you have hit the nail on the head. I do have two php.ini files which is obviouly causing problems....
| 12:50 pm on Sep 6, 2002 (gmt 0)|
Is it working now?
| 9:31 pm on Sep 6, 2002 (gmt 0)|
Yes it is thank you! The php.ini file had installed under C:\WINNT on my machine running XP Pro. I moved the file to C:\Windows, restarted Apache and bingo...
The next small problem I have is that send mail is working from my local machine but it seems to interperate scripts slightly differently and now, for example, a form that I am sending sends all the form fields along with all the variables appended to the fields. On the server it just sent the results of the fields!
Another late night...