QUOTE FORM AND MAIL() FUNCTION
My website is khantransport.com (built on HTML) hosted on Linode (Ubuntu 16.04.1 LTS). I have a quote form on the website, which works like a contact form. All the details of the form are to sent to one single email address all the time. However, I am having troubles with the mail function.
When I am running my site locally, upon clicking 'SEND' on the quote form, the email is going through. However, on the live version of the site the email is not going through. To me it looks like some sort of problems on server's end. Any help will be greatly appreciated! I used the following guide for smtp settings:
1). Installed SMTP
sudo apt-get install ssmtp
2). ssmtp.conf configuration
File Location: /etc/ssmtp/ssmtp.conf
mailhub=smtp.zoho.com:587
UseSTARTTLS=YES
AuthUser=
AuthPass=
File Location: /etc/php/7.0/apache2/php.ini
sendmail_path = /usr/sbin/ssmtp -t
Also, when I run the following command: /usr/sbin/sendmail -V
This is what i get: sSMTP 2.64 (Not sendmail at all)
4 Replies
You should check the logs to see how ssmtp behaves and what happens to the email.
I tried checking the logs using these commands
nano /var/log/maillog
nano /var/log/mail.log
nano /var/adm/maillog
nano /var/adm/syslog/mail.log
But it always creates a new file….can't seem to locate the logs. Any idea?
You should also know that ssmtp does not queue mail - if for some reason it cannot deliver a message, that message will be dropped. This can result in requests via your web form to be lost. You may want to consider setting up a real mailserver like Postfix in a send-only configuration (put inet_interfaces = loopback-only in main.cf
Postfix can be configured to send mail via a smarthost