April 27th, 2003, 04:30 AM
php mail function prob
Im realy trying here, and searching alot, but I seem to have goten stuck and need some guidence
I am haveing problems with the mail command, did alot of google searching but cant seem to find a solution that works. I set up a web server and mail server. The web server works, I downloaded and set up php. php also works, I verified it by makeing a test script that prints out some variables. Then I wrote a small mail script, never used mail function before I looked up examples in the php manual. This is on Windows 98. Not sure if my problem is a configuration problem with my web server, mail server, php, or the php script, but php script seems to be ok. I keep geting the error
Warning: mail() [function.mail]: SMTP server response: 550 User not local. We don't relay in C:\Program Files\www\site1\tester.php on line 23
I did a google search it came up with three results all of which contained my exact error. Here was one responce
When I looked in my mail server help file they talked of this, where the server evaluates the from address and domain name, seemed the answer would be to add my domain name to the local host list, so i added localhost and my ip address, hopeing this would help it to identify me as local.
yes, that's 100% normal. The "From:" address you specified has to be verified and validated by your SMTP server (the one you talk to with mail(), specified in the php.ini [mail] section, at least on Windows, and in server's configuration on *nix)
I configured php.ini as
Looking at the error seems php did make the conect to the server but the server dont recognise me as local, I always thought I was crazy but aparently the server don't heh,
SMTP= localhost ; for Win32 only
sendmail_from= journy101@localhost ; for Win32 only
Im realy glad it dont relay because i dont want spammers to use it, or anyone for that mater being its private. But I should be able to use my server.
SMTP connection with 127.0.0.1 ended. ID=16
Requested SMTP connection from 127.0.0.1
220 Private Mail Server Freeware, Version 4.8 (184.108.40.206)
250 Welcome [127.0.0.1], pleased to meet you
250 Sender "journy101@localhost" OK...
550 User not local. We don't relay
221 Aba he
SMTP connection with 127.0.0.1 ended. ID=17
Can anyone please guide me, I dont mind searching google, I just sometimes get stuck and sometimes I dont know what terms to use.
May 1st, 2003, 07:16 AM
I was since able to fix the problem, mainly hotmail.com is an external address and requires me to log into pop first. Also mail relay needed to be turned on strangely enough, makeing sure SMTP AUTH was enabled. This ensures not just anyone can send mail through server.
But to fix the PHP problem, If i mail to a local address then I do not need to log in first, and this way I can set my acount settings to then forward to hotmail.com
This did not work also so then I discovered I needed to provide a DNS address for it to look up domain names from and now I am all set.
I would like to add that I discovered www.phpbuilder.com while searching for answers and would recomend it to anyone haveing php problems </edit>