SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mail() and php.ini

    Ok,

    I have my php.ini file set up like this:

    Code:
      
    [mail function]
    ; For Win32 only.
    SMTP = smtp.postoffice.net
    ; For Win32 only.
    sendmail_from = jday@dynadirect-inc.com
    But I'm getting a warning that says "Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set()"

    What could be causing this? Thanks!
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  2. #2
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Does your ISP allow SMTP traffic? If not you will need your own SMTP server (like http://www.postcastserver.com).

  3. #3
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    Does your ISP allow SMTP traffic? If not you will need your own SMTP server (like http://www.postcastserver.com).
    I'm really not sure, but I thought it was strange that even when I changed "localhost" in my php.ini file to my actual smtp server that it still says "localhost" in the warning message. Is it supposed to do that? If so, I guess I'll look into the alternative you mentioned. Thanks.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  4. #4
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    hmmm...

    Where is your php.ini located?

  5. #5
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    hmmm...

    Where is your php.ini located?
    According to phpinfo(), it's at C:\Documents and Settings\Jim Day\Desktop\xampp\apache\bin\php.ini
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  6. #6
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jimday1982
    According to phpinfo(), it's at C:\Documents and Settings\Jim Day\Desktop\xampp\apache\bin\php.ini
    Ok well make sure that is the file you are editing. Sometimes there are a couple of php.ini files.

  7. #7
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    Ok well make sure that is the file you are editing. Sometimes there are a couple of php.ini files.
    Yep, that's the one I'm editing. Anyone else have any ideas?
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  8. #8
    SitePoint Evangelist Aska's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I may be totally off the mark here, but have you restarted Apache after you made that change in php.ini? Cheers.

  9. #9
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Aska
    I may be totally off the mark here, but have you restarted Apache after you made that change in php.ini? Cheers.
    OH! I don't know why I didn't think of that! Thanks. Now I'm getting a "530 Authentication required" warning so it's still not sending the e-mail. Any ideas on how to fix this? Thanks again.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  10. #10
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I think a 530 Authentication Error comes from the SMTP server itself. It usually means that you have to have authentication turned on to send the mail (usually done through Outlook).

    Try downloading PostCastServer and setting it up, it sends mail without having to authenticate.

  11. #11
    SitePoint Evangelist jimday1982's Avatar
    Join Date
    Sep 2002
    Location
    Atlanta, GA
    Posts
    562
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Hartmann
    I think a 530 Authentication Error comes from the SMTP server itself. It usually means that you have to have authentication turned on to send the mail (usually done through Outlook).

    Try downloading PostCastServer and setting it up, it sends mail without having to authenticate.
    OK, I'll give that a shot. But just for the sake of having one less thing running on my computer, is there a way to specify the login info for my smtp server in my php.ini file? Thanks.
    Jimmy Day
    Senior Systems Analyst
    Piedmont Healthcare Corporation

  12. #12
    chown linux:users\ /world Hartmann's Avatar
    Join Date
    Aug 2000
    Location
    Houston, TX, USA
    Posts
    6,455
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Well your host probably doesn't allow relaying (which is what you are doing). So, you can either download Postcast or you can use an SMTP server from this list -> http://www.yuki-onna.co.uk/email/smtpservers.html not all of them are guarenteed to work though.

  13. #13
    SitePoint Evangelist Aska's Avatar
    Join Date
    Aug 2003
    Location
    Melbourne, Australia
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you prefer to use your ISP's smtp server, you can look into the imap functions - especially imap_open and imap_mail. Hope that helps.


Bookmarks

Posting Permissions

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