Results 1 to 14 of 14

Thread: Mail Function Hangs

  1. #1

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Mail Function Hangs

    I run PHP 4 on an Apache 2 server. My Platform is windows 2000. When I use the mail function in PHP my browser hangs and so does PHP. There are no logs in the error log file.

    My PHP.ini file has the following set

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    SMTP = 25

    Can anyone help. I use the IIS smtp server by the way. Thanks in advance.

    ADAM
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  2. #2
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    you are using Apache and IIS at the sametime? enough said. How do you thinnk Apache will talk to IIS. Apache will send mail on it own id it is set up that way.

  3. #3

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Apache is a Web server Not an SMTP server. Apache listens on port 80 and IIS listens on port 25 for SMTP and port 21 for FTP. The IIS web server is turned off.

    I don't see any reason why that should be a problem. In actual fact the PHP manual says I can equally set the SMTP server to mail.btinternet.com my ISP's SMTP server and it should work - showing that the mail function has nothing to do with Apache.
    Last edited by visualAd; Feb 15th, 2003 at 04:59 AM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Apache is a Web Server? I had no idea.....

    give me a break. I know what it is. but you have apache installed as localhost then you can't send email.

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    SMTP = 25


    tht is set up as localhost. can't send mail very far if you don't even leave your computer. but I don't know what I am talking about. funny I don't have IIS and I can send mail just fine. but again don't listen to me as I just found out that apache is a "web server"

  5. #5

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Ok....

    I have apache listening on port 80 local host. However when connected to the internet its is just as accessable to the world as any other web site I just have to access it through my IP address.

    My SMTP server is also very much capable of sending email to any location in the world when I'm connected to the internet too. As is my FTP server.


    If you don't believe me:

    open up telnet when you are connected to the net:

    connect to [clientIP_address] on port 80 and type "GET /" and see the page unfold in front of you.

    Equally you could go to your favourite web browser and type in:
    http://[clientIP_address]/index.htm into your adress bar.

    Ask a friend in Africa connected to the internet to navigate to your IP and he will see what you see.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  6. #6
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    ok, IF you have Apache setup as LOCALHOST or 127.0.0.1, you or anybody else cannot get out to the net or get in from the net. Apache will not listen to that.

    again if you have 2 servers running at the sametime is pointless.

    but it seems you know more than me so you fix your own problem

  7. #7

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    I have apache set up as localhost and i can assure you that I can get in from the net. It's very easy. If however you edit the the httpd.conf file and change the listen directive to:

    Listen 192.168.1.1:80

    Assuming that is your IP address you will be the only one able to access the server. I often dump files in my local server root and then download them off my computer over the internet at college using my IP address.

    Secondly I don't have two servers running Read my first reply.

    Can anyone else help? - possibly someone a bit more polite?
    Last edited by visualAd; Feb 15th, 2003 at 04:17 PM.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  8. #8
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337

    Re: Mail Function Hangs

    Originally posted by visualAd
    I run PHP 4 on an Apache 2 server. I use the IIS smtp server by the way. Thanks in advance.

    ADAM
    hmmmm you just said it right there. you are using 2 servers OS's

    192.168 is for an in house networking and is not suppose to be access by the net. same as 10.10.. if you use something like 123.456.456.456 ( a real IP, then yeah you can) but, it is not setup as LOCALHOST. I can type that in if I knew you IP and get rigth in. but I can't type 192.168.. and get you as it would only be me.

    so you say you can type that in and it goes out to the net and reaches your computer? well I don't believe you.

    192.168.0.1:80
    type that in and see if you get me. you won't as it is only local for you, everybody in the world that has a computer has that number. it is set aside for LOCAL use only.

    I am not being rude as much as you are not listening to me as I try to help you fix your problem. if you don't want to listen than I am not going to help. again I use Apache and PHP only, NO IIS installed on my win98 computer. and guess what, I can send mail just fine.

  9. #9

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    Apache is a Web server Not an SMTP server. Apache listens on port 80 and IIS listens on port 25 for SMTP and port 21 for FTP. The IIS web server is turned off.
    This is what I said. All I know is that apache does not send email on my computer and I was not in the least bit surprised becuase it is only a web server. I have IIS installed but only use the SMTP and FTP NOT the web server. The web server is turned off.

    If however you edit the the httpd.conf file and change the listen directive to:

    Listen 192.168.1.1:80

    Assuming that is your IP address you will be the only one able to access the server.
    I also said this in my last post. Exactly what you repeated in your reply. It looks to me like you are not reading my posts and I have taken your advice.

    I removed IIS completely and tried it with just apache. I also tried it with a third party SMTP server. That was after your first reply and after some logical thought I realised that Apache is just a web server. Well the distribution I have anyway and that no program was listening on the SMTP port number 25.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  10. #10
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    and from the beginning. IF you setup Apache as localhost, 127.0.0.1, 192.168 you CANNOT send mail out with php. php has no access to the web if apache is installed as local. so if you set it up as NOT local then you change this

    [mail function]
    ; For Win32 only.
    SMTP = localhost
    SMTP = 25

    to this

    [mail function]
    ; For Win32 only.
    SMTP = your ISP's IP for mail
    SMTP = 25

  11. #11

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    PHP has nothing to do with Apache. In actaul fact you can run PHP stand alone with no server.

    I have tried setting the MAIL SMTP to my ISP SMTP server but still with no joy. I honestly do not think that is has anything to do with apache or local host. I think it has more to do with windows 2000. Because the function works on my Win 98 machine with Apache.

    Could I just ask what you have your SMTP server set as in your php.ini file?
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  12. #12
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Originally posted by visualAd
    PHP has nothing to do with Apache. In actaul fact you can run PHP stand alone with no server.
    TRUE, in DOS mode. but you have to have a server to run php in the browser, if you don't think so then I dare you to prove me wrong. look, if and only if Apache is setup as a server no localhost stuff then yes you can send email. just change the SMTP to your ISP's addy. most that I have seen are mail.isp.com.

    mine is mail.webspaz.net so go figure.

    if you set the SMTP to your ISP's mial server and you still can't send mail then you have a problem with the setup of php. maybe it is 2000 bloking you, who knows. if you have it working on win98 then what problems do you have?

  13. #13

    Thread Starter
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906
    The mail function just hangs and then times out with the Max execution time. The error says Could Not Recieve.

    My mate has actually made a webserver using PHP. But trust me I have apache set up as localhost and I can get in from the net I also have my SMTP and FTP setup on local host and again with my username and password I can get in from outside.

    The only reson I know this is because a couple of months ago when I installed a firewall it alerted me that people from outside could connect to ports 21, 25 and 80 and that it could be a security risk.
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  14. #14
    Frenzied Member
    Join Date
    Nov 1999
    Posts
    1,337
    Originally posted by visualAd
    The mail function just hangs and then times out with the Max execution time. The error says Could Not Recieve.

    My mate has actually made a webserver using PHP. But trust me I have apache set up as localhost and I can get in from the net I also have my SMTP and FTP setup on local host and again with my username and password I can get in from outside.

    The only reson I know this is because a couple of months ago when I installed a firewall it alerted me that people from outside could connect to ports 21, 25 and 80 and that it could be a security risk.
    that can happen even if you didn't have Apache installed.

    you don't need the port. just have your ISP's mailserver here
    [mail function]
    ; For Win32 only.
    SMTP = your ISP's IP for mailserver

    as to your HOST's mail server.
    Last edited by phpman; Feb 16th, 2003 at 11:58 AM.

Posting Permissions

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



Click Here to Expand Forum to Full Width