php mail function prob
Results 1 to 2 of 2

Thread: php mail function prob

  1. #1
    Senior Member
    Join Date
    Feb 2003
    Posts
    282

    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

    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)
    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.

    I configured php.ini as

    SMTP= localhost ; for Win32 only
    sendmail_from= journy101@localhost ; for Win32 only
    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 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 (4.8.3.4)
    HELO anon
    250 Welcome [127.0.0.1], pleased to meet you
    MAIL FROM:<journy101@localhost>
    250 Sender "journy101@localhost" OK...
    RCPT TO:<journy101@hotmail.com>
    550 User not local. We don't relay
    QUIT
    221 Aba he
    SMTP connection with 127.0.0.1 ended. ID=17
    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.

    Can anyone please guide me, I dont mind searching google, I just sometimes get stuck and sometimes I dont know what terms to use.

  2. #2
    Senior Member
    Join Date
    Feb 2003
    Posts
    282
    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.

    <edit>
    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>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

 Security News

     Patches

       Security Trends

         How-To

           Buying Guides