SMTP not working

Helpdesk for my helpdesk software

Moderator: mkoch227

Post Reply
tombullock92
Posts: 9
Joined: Wed Mar 21, 2012 1:56 pm

SMTP not working

Post by tombullock92 »

Hi,

Im trying to setup SMTP with my Hesk installation but I keep getting the error:

Code: Select all

"Could not connect to the host "smtp.domain.com":"

Resolving SMTP server domain "smtp.domain.com"...
Connecting to host address "10.0.0.3" port 25...
I can ping smtp.domain.com from the actual webserver so I know it can reach it but for some reason Hesk can't :?

The webserver is internal.

Any ideas?

Thanks
Tom
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP not working

Post by Klemen »

Is the "smtp.domain.com" correct?
Is the port correct? Blocked by firewall?
Does the SMTP server require SSL or TLS?
Is the username/password correct?
Does your PHP allow connections via fsockopen?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
tombullock92
Posts: 9
Joined: Wed Mar 21, 2012 1:56 pm

Re: SMTP not working

Post by tombullock92 »

Klemen wrote:Is the "smtp.domain.com" correct?
Yes
Klemen wrote:Is the port correct? Blocked by firewall?
No
Klemen wrote:Does the SMTP server require SSL or TLS?
No
Klemen wrote:Is the username/password correct?
Yes
Klemen wrote:Does your PHP allow connections via fsockopen?
Not sure, how would I check this?
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP not working

Post by Klemen »

If you add something like this in a PHP file (test.php) and open it in browser, does it throw an error or opens Google (or tries to redirect to a google local domain)?

Code: Select all

<?php
$fp = fsockopen("www.google.com", 80, $errno, $errstr, 30);
if (!$fp) {
    echo "$errstr ($errno)<br />\n";
} else {
    $out = "GET / HTTP/1.1\r\n";
    $out .= "Host: www.google.com\r\n";
    $out .= "Connection: Close\r\n\r\n";
    fwrite($fp, $out);
    while (!feof($fp)) {
        echo fgets($fp, 128);
    }
    fclose($fp);
}
?>
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP not working

Post by Klemen »

And is "10.0.0.3" correct IP of your SMTP server?
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
tombullock92
Posts: 9
Joined: Wed Mar 21, 2012 1:56 pm

Re: SMTP not working

Post by tombullock92 »

The test pages give this error:

Code: Select all

HTTP/1.1 302 Found Location: http://www.google.co.uk/ Cache-Control: private Content-Type: text/html; charset=UTF-8 Set-Cookie: PREF=ID=4eb852f62b0114aa:FF=0:TM=1334136346:LM=1334136346:S=Zp7-3IQuu5XtddP7; expires=Fri, 11-Apr-2014 09:25:46 GMT; path=/; domain=.google.com Set-Cookie: NID=58=YdOOwOO76w-83J5nlJEatfKW0P7hparEcn641_HL6X8tqMQZymBayS4HgzQoszXgC92gyadmKNBMlEUhez5WvEpiMNoxZTaD0ShiYsIvBwz4LVHIJ-PPS93uZW6s6Y3j; expires=Thu, 11-Oct-2012 09:25:46 GMT; path=/; domain=.google.com; HttpOnly P3P: CP="This is not a P3P policy! See http://www.google.com/support/accounts/bin/answer.py?hl=en&answer=151657 for more info." Date: Wed, 11 Apr 2012 09:25:46 GMT Server: gws Content-Length: 221 X-XSS-Protection: 1; mode=block X-Frame-Options: SAMEORIGIN Connection: close
302 Moved
The document has moved here. 
Yes, the server IP is correct.
Klemen
Site Admin
Posts: 10145
Joined: Fri Feb 11, 2005 4:04 pm

Re: SMTP not working

Post by Klemen »

Seems OK.

I'm afraid I'm out of ideas here. I would triple-check all settings but other than that I don't see a good reason why this wouldn't work on your server.
Klemen, creator of HESK and PHPJunkyardWas this helpful? You can buy me a drink here Image

Image You should follow me on Twitter here

Help desk software | Cloud help desk | Guestbook | Link manager | Click counter | more PHP Scripts ...

Also browse for php hosting companies, read php books, find php resources and use webmaster tools
tombullock92
Posts: 9
Joined: Wed Mar 21, 2012 1:56 pm

Re: SMTP not working

Post by tombullock92 »

Its a strange one....The first time I installed it I couldnt get it to work but then I managed to figure it out but since reinstallating it, Ive forgot! :lol:
I'll keep working on it!
Post Reply