Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+5 votes
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
Q2A uses PHPmailer() to send emails.  PHPmailer needs 'sendmail'.
Check if you have installed that package.  The sendmail service need not be enabled but the binary must be present.

Check if sending mail from your system works:
sendmail -v youremail@yourwork.com  < testfile.txt
  Create a testfile.txt with some contend and run the above command at a bash prompt.  Check if you received the email.

If that did not work, then I think you can specify a relay in sendmail config somewhere.  I don't recollect, please check the man page and try again.

Ensure your sendmail relay is reachable.  ping the relay or telnet to port 25 of the relay.

qa_send_email() throws an error if sending email fails.  You have to enable Apache logs and check /var/log/apache2/error.log.  I am not sure if PHP logging also needs enabling.

If that is not showing any error, then you can add your own error_log() statements to figure out where it is failing.
I downloaded sendmail files but where should I place those sendmail folder in our project.
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?
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.

Please log in or register to answer this question.