Failed to connect to mailserver at "localhost" port 25, verify your "SMTP"

Discussion in 'PHP' started by mylooieva, Nov 18, 2009.

  1. #1
    I am trying to send an email through a web form but I am getting an error......


    Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\sendmail.php on line 19

    Can someone tell me how to fix this?

    If this is my mail server not running problem, can anyone teach me how to on the mail server??

    Waiting for u all reply.

    Thanks.
     
    mylooieva, Nov 18, 2009 IP
  2. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Do you have PHP and a configured SMTP server installed on your local disk?
     
    Kelly2, Nov 18, 2009 IP
  3. mylooieva

    mylooieva Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I am php beginner. How can i know the php and configures SMTP server in my local disk??
     
    mylooieva, Nov 18, 2009 IP
  4. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Are you running this through an online server or from your computer hard drive?
     
    Kelly2, Nov 18, 2009 IP
  5. mylooieva

    mylooieva Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Now try at my computer, but in the future will be online server.
     
    mylooieva, Nov 18, 2009 IP
  6. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    You cannot test PHP scripts on your computer unless you have PHP installed, configured and set up. The same thing would be with a SMTP server.

    I would suggest finding a free host that allows both "SENDMAIL" and "PHP" just specifically for testing.
     
    Kelly2, Nov 18, 2009 IP
  7. SmallPotatoes

    SmallPotatoes Peon

    Messages:
    1,321
    Likes Received:
    41
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Edit your php.ini file and change the SMTP server configuration to point to your ISP's SMTP server (the same SMTP settings you put in Outlook/Thunderbird).
     
    SmallPotatoes, Nov 18, 2009 IP
  8. mylooieva

    mylooieva Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Last 2 week actually my email function is no problem. But dunno why, the warning came out since last week. I dunno where got the problem.
    I am using XAMPP.
     
    mylooieva, Nov 18, 2009 IP
  9. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Without viewing your email script or your configuration files I can help you no further. I would suggest back-tracking your edits and changes until you have it working again (meaning if you changed "red" to "blue" change it back to "red" and see if it is working or not.)
     
    Kelly2, Nov 18, 2009 IP
  10. mylooieva

    mylooieva Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I already change the SMTP server configuration same with Outlook. But dunno why last week the warning came out. Got any suggestion or solution???
     
    mylooieva, Nov 18, 2009 IP
  11. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    What was the last thing you remember editing before it broke, change that back and see if it works. Remember to make daily backups for such an event.
     
    Kelly2, Nov 18, 2009 IP
  12. mylooieva

    mylooieva Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    I think my coding is no problem. I would like to ask got any setting is need to change at the server to enable sending email?? I not so sure with the setting at server there. Can anyone help???
     
    mylooieva, Nov 18, 2009 IP
  13. Kelly2

    Kelly2 Peon

    Messages:
    79
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    The best thing you could do to ensure it is not the settings is first, save everything, then reinstall XAMPP in either a different directory or over the old/previous install location, then try the script again.
     
    Kelly2, Nov 18, 2009 IP