Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting i

Discussion in 'Installation and setup (Kayako Download)' started by Casey E, Jul 26, 2011.

  1. Casey E

    Casey E Member

    I am getting the following error message:


    [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() (PHP5/MAIL5.php:746)
    whenever I try to submit a ticket via the "Submit a ticket" interface. Any idea what is causing this? I am using an external SMTP server to send email, and that is working fine because I receive email correct, but apparently it is trying to use mail() to send tickets anyways? Is this a Kayako bug?
     
  2. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    Assumming in Admin CP, EMail settings you have ticket the box for enable SMTP email, then it should use the SMTP server you configure. However, what kayako does is first tries to use the SMTP that you configure, if that fails ( or it thinks it failed ) it then tries to use sendmail within php to send out directly.

    If you check your error logs in the admin CP, they should show you if the SMTP server you configured is failing to work

    Gary
     
  3. Casey E

    Casey E Member

    The problem is that sometimes it works, and sometimes it does not. Is there any way to increase the timeout value?
     
  4. Casey E

    Casey E Member

    In my error log it shows:

    PHP
    [Warning]: mail() [<a href='function.mail'>function.mail</a>]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() (PHP5/MAIL5.php:746)

    Mail
    Unable to connect to SMTP server

    But this only happens some of the time. I think increasing the timeout value will fix it, but I'm not even sure why it is trying to use localhost, because I have configured the SMTP server properly. Even when it fails, I still get an email as though it worked.

    Would this have anything to do with the fact that my website is using forced HTTPS, but my SMTP server does not accept SSL connections?
     
  5. Gary McGrath

    Gary McGrath Kayako Staff Staff Member

    No,

    Whats happening is its trying your SMTP server ( and I guess due to time outs, it "thinks" it failed, even though it maybe worked ), so it reverts to attempting to use sendmail from php ( and since you have not figured that at all, it errors out ).

    You could try replacing the smtp sending service, as kayako have a new one: http://forums.kayako.com/threads/a-better-email-send-library-patch-available.26695/

    Gary
     
  6. Casey E

    Casey E Member

    Thank you for this. I believe your guess is correct - that it times out and therefore it thinks it failed, and tries to revert to sendmail in php, which I have not configured because I am on a windows machine.

    I found what I think is the timeout setting in the existing SMTP sending service, but I went ahead and installed the new swiftmailer anyways. I guess we will try this and if it times out, we'll work on increasing the timeout setting in this service.

    Thanks,
    Casey
     

Share This Page