dcsimg
Results 1 to 10 of 10

Thread: mail(): Failed to connect to mailserver at "localhost" port 25

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    mail(): Failed to connect to mailserver at "localhost" port 25

    I'm trying to send an email using a PHP script and I get error message in the Title. I'm not sure what I have to do to fix this. I checked my php.ini file and the "smtp_port = 25". I'm running on Windows 10. Any ideas?

    Thanks,
    Blake

  2. #2
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,895

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    have you setup a mailserver on your local computer?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    No...and I'm not sure how to. I've been trying to find some online help for it and not having much luck.
    Blake

  4. #4
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,895

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    Then that would be your problem right there. There's nothing listening at port 25, therefore nothing to connect to. I'm going to take a wild guess that you've probably installed Apache to run PHP on... so you may want to take a look at JAMES (google apache james - I'd post a lin kbut VBF won't let me post links any more for some [expletive] reason)
    OR try googling "lightweight mail server".

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  5. #5
    Fanatic Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    913

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    Normally you'd be running PHP on a server (usually linux but can on Windows as well), which would have a mailserver running (or fairly easily installed/enabled), rather than a typical PC.

    Assuming that YOU can email from this PC using an email client (Outlook, etc), you can try using the settings you must use for that (i.e., smtp.yourisp.com, port, username, password).

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    tg,

    You are correct! I did install Apache and I will take a look at that link...Thanks!

    top,

    I don't have Outlook installed on my machine so I would need instructions on how to do this! Know of any good links for this? Thanks!
    Blake

  7. #7
    Fanatic Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    913

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    Quote Originally Posted by blakemckenna View Post
    I don't have Outlook installed on my machine so I would need instructions on how to do this! Know of any good links for this? Thanks!
    Outlook was just an example. Whatever email client you use on this PC, try using the same SMTP settings for this script. Perhaps something like this video will help you out.

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jan 2004
    Location
    Southern California
    Posts
    4,863

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    I don't have a mail client on my machine. I only use google mail.
    Blake

  9. #9
    Fanatic Member
    Join Date
    Dec 2014
    Location
    VB6 dinosaur land
    Posts
    913

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    Then use Gmail's SMTP settings as shown in that video.

    Unless you installed something like WAMP instead of only Apache, you don't have a mail server so you must use an external one. Even if you did install WAMP or something similar, there's often extra config to get mail to work and there's plenty of info on how to do that if you search for it.

  10. #10
    PowerPoster techgnome's Avatar
    Join Date
    May 2002
    Posts
    31,895

    Re: mail(): Failed to connect to mailserver at "localhost" port 25

    I wouldn't configure it to use your personal email... setup and use a local mail server or something you can easily control. That way you can control whether the emails actually get sent during testing, or if they just sit on the server.... and you won't get dinged for using your system for mass mailings... plus, what will you likely use for production?

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width