Results 1 to 11 of 11

Thread: PHP Error

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Question PHP Error

    Hi, I've got this error while testing one of my php script.

    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

    How can I debug this?

  2. #2
    <?="Moderator"?> john tindell's Avatar
    Join Date
    Jan 2002
    Location
    Brighton, UK
    Posts
    1,099

    Re: PHP Error

    You do not have a SMTP server running on your localhost. Just change the php ini settings. On windows it's normaly in the C:\Windows or C:\Winnt Folder.

    Code:
    [mail function]
    ; For Win32 only.
    SMTP = Your.ISP.SMTP.Server; for Win32 only
    Change it to your ISP SMTP server and then the error message you are recieve will disapear.

  3. #3
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: PHP Error

    yea i remember having that problem 2 but i just downloaded a PostCast Server cause changing the ini settings didnt work

  4. #4

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: PHP Error

    Thanks for the tips but my isp smtp server doesn't seems to work. Can I input other smtp server?

  5. #5
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: PHP Error

    What error do you get when you are attempting to connect the the SMTP server?
    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
    Hyperactive Member ninjanutz's Avatar
    Join Date
    Jun 2005
    Location
    Bayside
    Posts
    256

    Re: PHP Error

    if site is on ur own comp i think smpt is localhost but if site is on another server u have to contact them for the smpt and activate main in the php ini file if u have administrative capability or use the ini_set(); to temporarily activate mail for the duration of that script

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: PHP Error

    Thanks for the replies

    My error is

    Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.isp.com" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in c:\Inetpub\wwwroot\Mail.php on line 167

    1 mail have been sent to [email protected]
    Time Acquired: 0.0127399143782 seconds.
    Text Formatting : Plain Text

    The smtp server I try change to my isp smtp server and localhost and it won't work. Port is 25 right? I think is the bold step need to be edited but I not sure how? Please tell me more about ini_set(); settings, Thanks

  8. #8
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: PHP Error

    Are the PHP scripts running on your own system or are you using a web host. If you are using a web host then you need to contact them and ask them for details of the address of the SMTP server you need to use.
    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.

  9. #9

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: PHP Error

    its running on my own system using IIS with PHP.

  10. #10
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: PHP Error

    I assume you are sending the email using the same server you use to send emails from your computer normally. It appears that PHP is unable to connect to the SMTP server there could be a number of reasons for this. But the first thing to do is attempt to connect using telnet. If you cannot then this means the ISP is blocking your connection to the server. To test the connection using telnet follow these steps:
    [list][*]Type cmd at Start Menu --> Run[*]At the command prompt enter the following:
    Code:
    C:>telnet address.isps.smtp.server.com 25
    220 address.isps.smtp.server.com Microsoft ESMTP MAIL Service, Version: 6.0.3790.1830 ready at  Thu, 1
    Sep 2005 13:52:03 +0100
    If you don't get a message like above, but instead receive a timeout or connection refused message, it means that it has been blocked.
    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.

  11. #11

    Thread Starter
    Hyperactive Member
    Join Date
    Jan 2005
    Posts
    355

    Re: PHP Error

    Thanks but it still not working, I try my isp smtp server like telnet isp.smtp.com 25 and it did give me a reply like 220 isp20.smtp.com ESMTP ; Sat, 3 Sep 2005 19:59:02
    +0800 with a isp20 . But I try both smtp server also won't work and give me the same error msg in my php file. So sad

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