SMTP Error! Could not connect to SMTP host.

This forum is for issues with installing Joomla! on IIS webservers.

Moderator: General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Locked
User avatar
WebMystic
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Dec 23, 2009 9:42 pm
Location: New Jersey
Contact:

SMTP Error! Could not connect to SMTP host.

Post by WebMystic » Wed Dec 23, 2009 10:09 pm

My LAB set up:
I host my website and exchange.
Linux server running Fedora 12
Joomla 1.5.15
PHP 5.3.1
MySQL 5.1.41
Apache 2

Windows server 2003 R2 .32bit Exchange 2007

I'm new to configuring exchange 2007 and completely new to Fedora but love this stuff so trouble shooting is never an issue.

Experience with exchange 2003 so configuring the SMTP connector for EXCH 2007 wasn't that hard and all test demonstrate that it's up and working correctly. The outlook clients as well as iMail on my macbook pro are sending/receiving emails without an issue.

When I set the following Glabal Config
Mailer: SMTP SERVER
Mail from: [email protected]
From Name: anyname
Sendmail Path: /usr/sbin/sendmail
SMTP Authentication: Yes
SMTP Security: SSL
SMTP Port: 465
SMTP Username: Active Directory Name
SMTP Password: Password for AD athuntication
SMTP Host: smtp.xxxxxx.com

It returns the following error:
SMTP Error! Could not connect to SMTP host.

Does anyone have a fix.

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17350
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: SMTP Error! Could not connect to SMTP host.

Post by toivo » Fri Dec 25, 2009 8:09 pm

The SMTP port for sending emails is TCP port 25. Are you sure your SMTP server needs authentication if both server are in the same network?
Toivo Talikka, Global Moderator

User avatar
WebMystic
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Dec 23, 2009 9:42 pm
Location: New Jersey
Contact:

Re: SMTP Error! Could not connect to SMTP host.

Post by WebMystic » Sat Dec 26, 2009 2:13 am

Thanks for the reply toivo, i was losing hope that anyone would help. Anyway I've tried port 25 and 587 and alway the same respone:
SMTP Error! Could not connect to SMTP host.

User avatar
Per Yngve Berg
Joomla! Master
Joomla! Master
Posts: 30813
Joined: Mon Oct 27, 2008 9:27 pm
Location: Romerike, Norway

Re: SMTP Error! Could not connect to SMTP host.

Post by Per Yngve Berg » Sat Dec 26, 2009 9:33 am

Try without using ssl.

SMTP Security: None
SMTP Port : 25

User avatar
WebMystic
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Dec 23, 2009 9:42 pm
Location: New Jersey
Contact:

Re: SMTP Error! Could not connect to SMTP host.

Post by WebMystic » Sat Dec 26, 2009 1:22 pm

Same result.

I have a .MAC account which I used. .MAC SMTP server works with Joomla's application server with out a problem, which tells me two possible things:
1st .MAC SMTP server doesn't use SSL and authenticates using User Name/Password.
2nd Exchange 2007 may need additional configuring in the HUB transport (don't know enough about it yet), so I purchased a NEW book, "Configuring exchange Server 2007" which should tell me about configuring 3rd party application servers such as Joomla. If anyone already understands EXCH2007 new HUB transporter technology then JOIN IN :)

Mystic

DirtBanger
Joomla! Apprentice
Joomla! Apprentice
Posts: 20
Joined: Sun Jan 24, 2010 9:57 am

Re: SMTP Error! Could not connect to SMTP host.

Post by DirtBanger » Mon Jan 25, 2010 1:07 pm

I am sitting with the same issue and have tried all the settings

User avatar
WebMystic
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Wed Dec 23, 2009 9:42 pm
Location: New Jersey
Contact:

Re: SMTP Error! Could not connect to SMTP host.

Post by WebMystic » Tue Feb 02, 2010 12:44 am

I'm back with the same issue after eliminating the fact that it could be my exchange 2007 server. Once I was sure I had configured my server correctly, I installed a copy of Drupal who also uses a PHP file to control the registration and email function. My Drupal site works perfiectly, however I must admit that I like the control that Joomla allows which is why I'm sticking with this CMS product.

I tell you Joomla community - I'm surprised no one has answered Dirtbanger though and here I'm back with the save question. I've search a number of blogs, some dated back to 2006 and NOT ONE blog ends with a clear and concise solution.

So Joomla community - DOES ONE EXIST???????? Is there a clear answer as to WHY the PHP mail class doesn't work?

If this is an OLD RESURRECTED TOPIC as Coolbung points out on the following thread:
http://forum.joomla.org/viewtopic.php?f ... p#p1334730
then were is the answer?

Dreamz
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Fri Feb 05, 2010 6:41 am

Re: SMTP Error! Could not connect to SMTP host.

Post by Dreamz » Fri Feb 05, 2010 6:50 am

I am also facing this type of error. Now i will try this. Hope this will overcome on errors.

Chauncey
Joomla! Apprentice
Joomla! Apprentice
Posts: 21
Joined: Fri Jun 12, 2009 9:40 pm

Re: SMTP Error! Could not connect to SMTP host.

Post by Chauncey » Wed Feb 24, 2010 10:07 pm

If you are trying to set up Outlook:


This has nothing to do with Joomla! It has to do with your internet carrier. Most have stopped excepting port 25 and you must now use their SMTP servers!

Check out this link: http://www.cordhosting.com/smtp_settings.php

You will find most cable companies are doing this now for Spam purposes etc. Good Luck and hope the info helps!!

vaworx
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 05, 2008 4:34 am

Re: SMTP Error! Could not connect to SMTP host.

Post by vaworx » Sun Mar 28, 2010 9:51 pm

Always easy when you know how :)

Go ahead and logon to your Exchange 2007 server and open up the Exchange Management Shell. Create an Anonymous Relay Send connector which authorizes send mail by an IP ACL. Make sure you perform the two steps of this process: creating the connector, granting the anonymous permission for that connector, then take out any SMTP authentication from the SMTP settings in your Joomla or other scripts.

Going that route will also stamp your outgoing emails so that they don't get tagged as SPAM which happens otherwise even if you use a regular SMTP relay with user/pass authentication.

http://www.valogic.net/support/index.ph ... ticleid=80

Cheers!
Vlad

lsoares
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Tue Dec 15, 2009 4:21 am

Re: SMTP Error! Could not connect to SMTP host.

Post by lsoares » Fri May 21, 2010 5:42 pm

I am currently fighting the exact same issue. I have been working on this for 2 weeks now, scouring the posts and internet, but no help.

I am using Joomla on a Windows 2008 Server, Exchange 2007.

Get same error as outlined in this post.

Without email from our Joomla site to our exchange server, our site is useless.

vaworx
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Mon May 05, 2008 4:34 am

Re: SMTP Error! Could not connect to SMTP host.

Post by vaworx » Sat May 22, 2010 1:50 am

Isoares, have you tried using SMTP authentication account for sending emails instead. Me i have never installed Joomla on Windows, especially 2008. Try disabling the UAC which might be blocking something too.

northstarone
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Sun Sep 20, 2009 12:57 pm

Re: SMTP Error! Could not connect to SMTP host.

Post by northstarone » Thu Jul 08, 2010 8:08 am

its not asd difficult as you may think, talk to your host provider and ask them to allow smtp on your server by releasing the firewall on it..

miocara.com - social networking with a difference

User avatar
terveg
Joomla! Apprentice
Joomla! Apprentice
Posts: 7
Joined: Sat Oct 09, 2010 9:23 am
Contact:

Re: SMTP Error! Could not connect to SMTP host.

Post by terveg » Fri Nov 19, 2010 9:33 am

Hi!
I've the same problem
SMTP Error! Could not connect to SMTP host.
BUT
I don't change my options SMTP recommended by hosting company-it was working normally before one day.
I tried to change options to other mail host like smtp.yandex.ru. It started work! but with hosting options doesn't work.
Can anybody say it is hoster problem or joomla (1.5.20) ? ???
Can it be caused by sent mail queue?
http://scottishfold.mk.ua/-Scottishfold Cats Ukraine

nibelungen
Joomla! Apprentice
Joomla! Apprentice
Posts: 8
Joined: Sat Mar 28, 2009 10:58 am

Re: SMTP Error! Could not connect to SMTP host.

Post by nibelungen » Fri Apr 15, 2011 8:38 am

Hi,
I had the exact same problem but now I have solved it. I'd like to share my solution. I have Joomla version 1.5.22

My Global Config was as follows;

Mailer: SMTP SERVER
Mail from: [email protected]
From Name: *Name*
Sendmail Path: usr/sbin/sendmail
SMTP Authentication: Yes
SMTP Security: SSL
SMTP Port: 465
SMTP Username: *username*
SMTP Password: *password*
SMTP Host: *hostname*

This retured following error
SMTP Error! Could not connect to SMTP host.

After working on this problem I found out that the problem was related with my sendmail path. Because I had Acymailing newsletter extension, and I was able to send and receive messages through that with no problem.

So, in the Joomla configuration panel I tried to change the Sendmail path to

Sendmail Path: components/com_acymailing/inc/phpmailer/class.smtp.php

And it worked like a charm! 8)

kellyshl
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Mon May 21, 2012 9:57 am

Re: SMTP Error! Could not connect to SMTP host.

Post by kellyshl » Mon May 21, 2012 10:00 am

i successfully sent mail using jNews <-- i faced error with it but i can mass send
using the following configuration. =)
You do not have the required permissions to view the files attached to this post.

elvira21
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Thu May 01, 2014 5:56 pm

Re: SMTP Error! Could not connect to SMTP host.

Post by elvira21 » Thu May 01, 2014 6:03 pm

Hello
could somebody help me? I am very new in joomla.
I have problem at contact page:I have this message
SMTP Error! Could not connect to SMTP host.
Mailer - SMTP SERVER
Mail from - [email protected]
From Name - company name
Sendmail Path -usr/sbin/sendmail
SMTP Authentication No Yes - Yes
SMTP Security - SSL
SMTP Port - 465
SMTP Username - usernam
SMTP Password - password
SMTP Host - smtp.gmail.com

User avatar
toivo
Joomla! Master
Joomla! Master
Posts: 17350
Joined: Thu Feb 15, 2007 5:48 am
Location: Sydney, Australia

Re: SMTP Error! Could not connect to SMTP host.

Post by toivo » Thu May 01, 2014 7:00 pm

First, if you still run Joomla 1.5, you should consider migrating urgently to a safer, supported version like 2.5 or 3.x.

Here is a tutorial which will hopefully solve the connection issue, if the problem is at Gmail's end:
http://docs.joomla.org/How_do_I_use_Gma ... _server%3F
Toivo Talikka, Global Moderator

User avatar
sunshine1688
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Mon Jun 27, 2011 1:59 pm
Location: Thailand
Contact:

Re: SMTP Error! Could not connect to SMTP host.

Post by sunshine1688 » Tue May 20, 2014 7:30 pm

I suggest u can use some free or paid smtp Mail service like Mailgun, they have their own independent smtp server & it'll help u to avoid many mail problems on joomla 1.5 2.5 3.x, I like it very much personally.

JoosenWPL
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Wed Apr 16, 2014 3:57 am

Re: SMTP Error! Could not connect to SMTP host.

Post by JoosenWPL » Wed Sep 17, 2014 10:23 pm

Solution for users hosting there e-mail and website on the same server (hosting company). Which is the case for most Joomla sites i guess.

Use the following settings:

Send mail: yes
Mailer: SMTP
From e-mail: [email protected]
From name: Sender name
SMTP authentication: yes
SMTP security: none (you can set this to yes if you have ssl)
SMTP port: 587 (465 if you use ssl)
SMTP username: [email protected]
SMTP password: [password] (same pass you use to login to your inbox)
SMTP host: localhost (this is because you host the mail server and website on the same server, most people try smtp.yourdomain.com. This will result in an error)

Strange nobody came up with this answer.

yapindo
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Wed Apr 20, 2016 7:59 am

Re: SMTP Error! Could not connect to SMTP host.

Post by yapindo » Wed Apr 20, 2016 8:02 am

JoosenWPL wrote:Solution for users hosting there e-mail and website on the same server (hosting company). Which is the case for most Joomla sites i guess.

Use the following settings:

Send mail: yes
Mailer: SMTP
From e-mail: [email protected]
From name: Sender name
SMTP authentication: yes
SMTP security: none (you can set this to yes if you have ssl)
SMTP port: 587 (465 if you use ssl)
SMTP username: [email protected]
SMTP password: [password] (same pass you use to login to your inbox)
SMTP host: localhost (this is because you host the mail server and website on the same server, most people try smtp.yourdomain.com. This will result in an error)

Strange nobody came up with this answer.
This work like a charm! Tyvm

fhariano
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Tue Oct 24, 2017 1:09 pm

Re: Joomla 3.8.X SMTP Error! Could not connect to SMTP host.

Post by fhariano » Tue Oct 24, 2017 1:21 pm

Hi.

I edited the file: libraries\vendor\phpmailer\phpmailer\class.phpmailer.php

+/- in line 1642 after this IF:

if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) {
$prefix = 'ssl://';
$tls = false; // Can't have SSL and TLS at the same time
$secure = 'ssl';
} elseif ($hostinfo[2] == 'tls') {
$tls = true;
// tls doesn't use a prefix
$secure = 'tls';
}


I added the line:

$options = $this->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);


It's worked for me. :)

accessvirus
Joomla! Apprentice
Joomla! Apprentice
Posts: 5
Joined: Tue Jul 24, 2012 8:25 am

Re: SMTP Error! Could not connect to SMTP host.

Post by accessvirus » Thu Nov 23, 2017 11:38 am

optional sollution for smtp mail running on microsoft exchange 2010 when mail does not run on a local mailserver

first set 2 things. SPF record and external mx in dns. depending on the TTL all you do after this only works when the TTL is passed depending on your mailserver location.

Setting SPF
"v=spf1 a mx ptr ip4:123.456.789.101 ip4:123.456.789.102 -all"

Note: put the server ip after ip4: and place -all instead of a commonly used ~all which means that it is not really blocking it but notifies it in the mail log. -all means only explicitly allowed for the ip addresses in the spf record.

Then go and verify the record via mxtoolbox.com. If you have no record selected, be sure to set it to TXT in the dns.

Setting mailserver
note: Most microsoft mailserver send unprotected mails. So no ssl/tls or startls.be aware that you disable local MX mailserver delivery (in my case inside the user account of direct admin) and that you configured the DNS in a way that the mx record points to an external provider like microsoft or spamexperts. If you use microsoft exchange 2010 (or any other version), please check if there is a spamfilter in between your joomla site and the destination @ microsoft and configure it properly and that it is not on the same server in this tutorial case. Ask your clients IT department that configured microsoft exchange to change port 25 to 26 (or any other port, preferably in the uppper number region to prevent populair port scanning). If you run in trouble you can use a tool like PUTTY to first test if you have the right port:

1. Open putty.
2. At hostname (or IP address) you fill in mail.domain.tld (or any other subdomain (check DNS settings of domain to see the right hostname. If the hostname is correct. Note that IF there is a spamfilter for an mx record like mx.spamexperts.com, you should ask the IT deparment who manages their exchange server for what you need to fill in at mail.domain.tld)
3. Fill in the port you think it should be. Otherwise also contact their IT department.
4. select TELNET from the radio button options.
5. A propt box opens. Enter ELHO and see what happens. IF you get an error, it's not the right port. If you get a list of 250 code functions, then you know you are set and that hostname and port are correct.


So, now you know the port and the hostname. Now go to your joomla settings and set SMTP security to NONE and authentication to NO.

Note: Be aware to disable local mail delevery inside your plesk or direct admin where the site is hosted on.


Locked

Return to “Joomla! 1.5 on IIS webserver”