Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
0 votes
5.1k views
in Q2A Core by

This is what happens when a mail is supposede to be sent. (feedback form, confirmation mail for account, etc..)

I use external SMTP and everything is correct for settings, so I have no clue where can the problem be in Question2Answer.

---------------------------------------------------------------------------------------------------------------

Question2Answer fatal error:

Could not send email confirmation
 
Stack trace:
 
require() in index.php:31
require() in qa-index.php:175
qa_get_request_content() in qa-page.php:789
qa_call_override() in qa-page.php:198
qa_call() in qa-base.php:579
qa_get_request_content_override_1_in_qa_cv_overrides_php() in qa-base.php:532
qa_get_request_content_base() in qa-base.php(510) : eval()'d code:9
qa_call() in qa-base.php(577) : eval()'d code:1
qa_get_request_content() in qa-base.php:532
require() in qa-page.php:207
qa_send_new_confirm() in qa-page-confirm.php:54
qa_call_override() in qa-app-users-edit.php:244
qa_call() in qa-base.php:579
qa_send_new_confirm_override_1_in_overrides_php() in qa-base.php:533
---------------------------------------------------------------------------------------------------------------
 
Any idea in how to fix it ?
 
Thank you.
Q2A version: 1.6.3

1 Answer

+1 vote
by
The use of an external SMTP service could be blocked by your provider.

Try first to use your provider's SMTP service using real (=defined in your domain's Cpanel) email addresses for the "sender address" and the "email address for the admin messages"
by
No, my provider is not blocked. As I said everything is correct in settings and mail is working fine outside Question2Answer, that is the problem.

Thank you.
by
Just to know (and exclude it), how did you verify that your hosting provider is not blocking your sw to use an external SMTP service ?
Furthermore, what do you mean with "mail is working fine outside Question2answer" ?
by
1- "hosting blocking sw" What do you mean by sw ?

2- I can use the service in any mail app without problems, if I add the same settings to any CMS it works. (same hosting)

Thanks.
by
1) sw = q2a
2) same domain ?
Just for troubleshooting purposes, did you try to use your hosting provider SMTP service with a real email address ? (see my previous post)
Try it and post here the result pls
by
Not same domain, but same server with different CMS.

Yes, if I disable SMTP external it works as default using the server, the problem is that I need to use the external service and by some reason Q2A throws that fatal error.

Thank you.
by
So :
- local SMTP service ---> OK
- third party (external) SMTP service ---> KO

Q2A is installed correctly, because in case 1 it is working.
The issue looks like to be OR in wrong SMTP settings you are using OR in something "external" to your Q2A (eg:  restrictions by your provider)
Are you on a shared hosting or on a VPS ?
Could you post the SMTP settings you are using ?
by
The provider is mailgun, I have no restrictions at all.
The SMTP settings are the same as any provider:
The smtp server, the user and the password, nothing extra or complicated.

Thank you.
by
> The provider is mailgun
Ok
>I have no restrictions at all.
Ok. But I still do not understand how you can exclude it
> The SMTP settings are the same as any provider
I asked yours (no user and pwd, of course)

Are you on a shared hosting or on a VPS ?
by
In Admin > Emails if you uncheck send email using SMTP instead of local, then its not used and I use the server mail. (so its excluded)

If I check that, I enter my mailgun credentials and I get the error. Its a VPS.

Thank you.
by
> In Admin > Emails if you uncheck send email using SMTP instead of local, then its not used and I use the server mail. (so its excluded)

Ok, thanks.
But this is another test...By this way you are using "sendmail"

As I asked before, can you confirm to me that you have **selected**
"Send email via SMTP instead of local mail"
and used "SMTP server address" and "SMTP server port" parameters given to you by your local hosting provider ?

That is, have you tried SMTP but with different parameters ? (those provided to you by your hosting provider and not those of mailgun)
by
Furthermore, try also this.
1) download this file (testsmtp.php)
https://www.dropbox.com/s/cqvq4ngcr9s3sj0/testsmtp.php?dl=0
2) open it and change the parameters (now it's configured to use gmail) inserting the parameters that you think should work
3) put it inside your q2a **docroot**
4) invoke it :
http://www.yourq2awebsite.com/testsmtp.php
5) Post here the result you see on your browser

ps
Exec also the previous test I told you (SMTP on q2a with your hosting provider's service parameters)
by
Without external I just added no-reply@mydomain.com and it works. I did not create that account, I just added it like that and Q2A sends the mails fine.

I get this with your file:
SMTP -> ERROR: Failed to connect to server: Connection timed out (110) Mailer Error: SMTP Error: Could not connect to SMTP host.

Thank you.
by
1) About the test with q2a :
"Without external I just added no-reply@mydomain.com and it works. I did not create that account, I just added it like that and Q2A sends the mails fine."

Sorry, I've not understood if you have used the SMTPservice of your provider or NOT (you have to select "use SMTP instead of local" using your hosting provider's SMTP service parameters)

2) About the test with my php file :
SMTP -> ERROR: Failed to connect to server: Connection timed out (110) Mailer Error: SMTP Error: Could not connect to SMTP host.

If the server address and port that you've used are correct, you cannot reach that mail server on that port with SMTP.(on ssl ? I do not know your settings)
In that case you should ask your provider to open that host/port.
Let me know.
by
"Sorry, I've not understood if you have used the SMTPservice of your provider or NOT (you have to select "use SMTP instead of local" using your hosting provider's SMTP service parameters)"

SMTP External off, it sends fine.
SMTP instead of local using the correct credentials fail.

The smtp server is "smtp.mailgun.org" and its correct.

If I enable "use SMTP instead of local"

I have:
SMTP server: smtp.mailgun.org
Port: 25 (changing to 465 and 587 does not work as well)
Secure connection: OFF (changing to SSL or TLS does not work as well)
User: the user
Pass: the pass

And I have the error.

Thank you.
by
Let's see what happens with telnet.
Open a terminal and exec this 3 commands :

1) telnet smtp.mailgun.org 25
2) telnet smtp.mailgun.org 587
3) telnet smtp.mailgun.org 2525


and post here the result

ps
http://documentation.mailgun.com/faqs.html#i-am-getting-timeouts-when-connecting-via-smtp-why
(section : "I am getting timeouts when connecting via SMTP. Why?")
by
I tested that before and shows me that there is no connectivity issue between the server and the mailgun server:

# telnet smtp.mailgun.org 465
Trying 50.56.21.178...
Connected to smtp.mailgun.org.
Escape character is '^]'.

So the only thing that may have the problem is Q2A. I see there are a lot of threads like this and none of it has a solution.

Thank you.
by
Could you pls post the infos I've requested to you ?
by
The port you should use (see : http://blog.mailgun.com/25-465-587-what-port-should-i-use/) is 587.
If that's blocked, the 2525.

Test them with my php file too.
by
But follow the steps above
...