Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+7 votes
1.3k views
in Q2A Core by
edited by
I am unable to send emails. Both Local and SMTP emails aren't working.
Registration email verification/confirmation is also not working. Emails aren't being sent.

I don't know where to check logs. Where are the logs located?

My version of PHP is 7.4 and I am using Nginx server.
Q2A version: 1.8.6
by
You have not provided enough information for anyone to even guess at what the problem might be. Please edit your question and describe your current configuration in more detail (you may obfuscate sensitive information like hostnames or credentials, of course).

If you configured the server to use local mail: what is the local mail server you're using, and how is it configured?

If you configured sending mail via SMTP: what settings did you configure (again: you may obfuscate hostnames and credentials, but nothing else), and can you manually access the SMTP server from the web server using those parameters?
by
You can install 'sendmail' with
apt install sendmail.

sendmail logs will be in /var/log/mail and also in /var/log/syslog

As Ansgar mentioned, please provide more (obfuscated) details on your configuration and what you have tried.
by
I am getting this error:


2022/03/19 10:39:33 [error] 846#846: *3087 FastCGI sent in stderr: "PHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" while reading response header from upstream, client: 27.59.216.44, server: xyz.myslns.com, request: "POST /index.php?qa=admin&qa_1=mailing HTTP/1.1", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "xyz.myslns.com", referrer: "http://xyz.myslns.com/index.php?qa=admin&qa_1=mailing"
2022/03/19 10:41:13 [error] 846#846: *3095 FastCGI sent in stderr: "PHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/TroubleshootingPHP message: PHP Question2Answer email send error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting" while reading response
by
I have not used PHPMailer myself, but the error message ("SMTP connect() failed") indicates that your Q2A host can't connect to the remote server (xyz.myslns.com). If you have shell access to your Q2A host you can verify that e.g. by running the following command:

telnet xyz.myslns.com 25

If port 25 on that host is not accessible, you should receive output like "telnet: Unable to connect to remote host: Connection refused."

Is xyz.myslns.com a host operated by you? If so, check if the mail service on that host is actually running and listening on port 25.

Also check with the provider where your Q2A server is hosted if they block outbound traffic to port 25. Many providers do this for spam prevention. Those who do usually provide a mail relay host through which you must send outgoing e-mail.

As a side note: please do NOT bury relevant information like the above error messages in comments. Instead edit your question and append the information there.

Please log in or register to answer this question.

...