# SMTP connection failed.

**URL:** <https://forum.mautic.org/t/smtp-connection-failed/1787>\
**Category:** Product Support\
**Created:** [April 29, 2015, 4:56pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787 "2015-04-29T16:56:52Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [April 29, 2015, 4:56pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/1 "2015-04-29T16:56:52Z")

</div>

I tried to use mandrilapp and gmail and every time after Save&close Or Apply the system loses the password and dont work anymore.  
by steps:  
I complete all smtp configuration and test it. Success!! even I receive the email: "Hi! This is a test email. Testing...testing...1...2...3!"  
I click Save & close  
I reload and test it again with this result:  
Expected response code 250 but got code "535", with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [April 29, 2015, 4:56pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/2 "2015-04-29T16:56:52Z")

</div>

I tried to use mandrilapp and gmail and every time after Save&close Or Apply the system loses the password and dont work anymore.  
by steps:  
I complete all smtp configuration and test it. Success!! even I receive the email: “Hi! This is a test email. Testing…testing…1…2…3!”  
I click Save & close  
I reload and test it again with this result:  
Expected response code 250 but got code “535”, with message "535-5.7.8 Username and Password not accepted. Learn more at 535 5.7.8

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [April 29, 2015, 5:11pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/3 "2015-04-29T17:11:36Z")

</div>

Hi Miguel,

The password does not reshow for security reasons but it does save so should work.

After saving the configuration, can you check your app/config/local.php file and look for a mailer\_password entry. Is the password correct there?

Thanks,  
Alan

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [April 29, 2015, 6:21pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/4 "2015-04-29T18:21:06Z")

</div>

Thx alanhartless

but don’t work ☹

After test and save & close the configuration:

I have 2 leads in the “global” list  
I created a new email to send to “global” list  
I “send example” and the program said : “A test email has been sent to your email.”  
But I haven´t received the mail  
I also tried the button “send” but nothing happened (no emails received)

but the resume in email says: emails sent: 2  
test global Uncategorized 2 0 ~0 6

In the lead:  
test global  
At April 29, 2015 9:02 pm, Email Sent.  
Email probably had not been read yet. Email was sent to this Lead because he/she belongs to ‘Global’ List.

Mandrilapp don’t show activity :S (the only mail they show is “Mautic test email”)

Is mautic going to show the problem if the smtp connection fails?

---

<div class="post-metadata">

**Author:** ![gmillard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/gmillard/32/5_2.png) [@gmillard](https://forum.mautic.org/u/gmillard)\
**Post date:** [April 29, 2015, 6:30pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/5 "2015-04-29T18:30:05Z")

</div>

If SMTP fails, it is recorded in the app/logs/mautic\_prod.php file. We do have a fix coming in 1.0.4 where emails will not be marked as sent if the there was a SMTP error.

Are you sure you are using a live API key for Mandrill and not a test key? Test keys will not send the email.

Also, what do you have set for “How should email be handled?” in the Configuration? If “Send immediately” is selected, then it shouldn’t be an issue. But if you have “Queue” selected, then read through [https://www.mautic.org/docs/emails/index.html](https://www.mautic.org/docs/emails/index.html).

Thanks,  
Alan

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [April 29, 2015, 8:12pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/6 "2015-04-29T20:12:53Z")

</div>

Hi Alan,

Thx for the support,

Are you sure you are using a live API key for Mandrill and not a test key?  
Yes is not in test mode. When I use the test email function in mautic they send one email and mandrill track it.

Also, what do you have set for “How should email be handled?” in the Configuration?

I have selected “send immediately”

I’m not completely sure that I’m well created the email campaign. What is the most easy way to test the smtp mail system?

I created a new list.  
I add 3 leads to this list  
I create new email and select these new list (they show total=3)  
I click the button “send” in the new email (they show send=3 read=0 Falied=0)  
No more things happend ☹

If I do: configuration–\> Mail Settings --\> Paste the mandril key in “Password for the selected mail service” and click Send test email so it send a test email to mi email and explain succes in green.

But if I don’t paste te mandril key (the password) and i want to send a test mail the result is:  
Failed to authenticate on SMTP server with username “xxxxxxx” using 1 possible authenticators  
++ Starting MauticCoreBundleSwiftmailerTransportMandrillTransport \<\< 220 [smtp.mandrillapp.com](http://smtp.mandrillapp.com) ESMTP \>\> EHLO …

I think the form is not saving my password properly

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 3, 2015, 2:42pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/7 "2015-05-03T14:42:41Z")

</div>

What is the most easy way to test the smtp mail system?

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 4, 2015, 9:23am UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/8 "2015-05-04T09:23:26Z")

</div>

Now it works without new actions :S

Now the test run in configuration page.

I think the problem could be caching of data for conection but I dont know realy

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 5, 2015, 10:24am UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/9 "2015-05-05T10:24:28Z")

</div>

I did a new mautic instalation and I have the same problem.

I reported the problem as a bug [https://github.com/mautic/mautic/issues/367](https://github.com/mautic/mautic/issues/367)

If someone can help me to solve the problem to use full mautic I’ll apreciate much. I tried to change everything and don’t work ☹

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 5, 2015, 10:44am UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/10 "2015-05-05T10:44:05Z")

</div>

I found new data. The email (in campaign) is send directly by the server by php mail. It don´t use the mandrill configuration to send the email.

Received: from 127.0.0.1 (EHLO xxxxxxx.yyyyyyyyyy.es) (XX.XX.XX.XX) \<— This is the server when mautic is hosted  
by [mta1015.mail.bf1.yahoo.com](http://mta1015.mail.bf1.yahoo.com) with SMTPS; Tue, 05 May 2015 11:26:00 +0000  
Received: by xxxxxxx.yyyyyyyyyy.es (Postfix, from userid 10057)  
id 5AA905C5D2C; Tue, 5 May 2015 13:25:58 +0200 (CEST)

---

<div class="post-metadata">

**Author:** ![chad.windnagle](https://avatars.discourse-cdn.com/v4/letter/c/7feea3/32.png) [@chad.windnagle](https://forum.mautic.org/u/chad.windnagle)\
**Post date:** [May 5, 2015, 1:15pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/11 "2015-05-05T13:15:48Z")

</div>

Hi Miguel

Looks like settings aren’t being found by Mautic. If you clear cache that should help. To clear your cache you can run:

`php app/console clear:cache -e prod 
php app/console clear:cache -e dev`

If you can’t run the cache script go ahead and delete the cache directory at app/cache

That should allow the new mail settings to get picked up.

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 5, 2015, 2:10pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/12 "2015-05-05T14:10:38Z")

</div>

php app/console cache:clear -e prod --\> OK

php app/console cache:clear -e dev --\> Fatal error

I trie to complete the form that generate the email is send to lead and the headers of email not use the mandril configuration. Is connecting through php mail directly (the headers of email show the name of the server)

[https://github.com/mautic/mautic/issues/367](https://github.com/mautic/mautic/issues/367)

Now i’ll trie to erase all contents of cache directory

---

<div class="post-metadata">

**Author:** ![Miguel](https://avatars.discourse-cdn.com/v4/letter/m/439d5e/32.png) [@Miguel](https://forum.mautic.org/u/Miguel)\
**Post date:** [May 5, 2015, 2:30pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/13 "2015-05-05T14:30:18Z")

</div>

I deleted all contents of cache directory and NOW WORKS

The headers in the mail that the lead receive (when the lead fill a form) now show the sender is mandrill! The problem were the configuration cache.

Thx Thx Thx a lot

---

<div class="post-metadata">

**Author:** ![silavapi](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/silavapi/32/7424_2.png) [@silavapi](https://forum.mautic.org/u/silavapi)\
**Post date:** [February 2, 2020, 10:59pm UTC](https://forum.mautic.org/t/smtp-connection-failed/1787/14 "2020-02-02T22:59:57Z")

</div>


