QUOTE FORM AND MAIL() FUNCTION

Hello,

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=haris@khantransport.com

AuthPass= 3). php.ini configuration

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

Could it be, that the email is actually sent, but rejected by zoho?

You should check the logs to see how ssmtp behaves and what happens to the email.

Thanks.

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?

Sorry, I have no idea because I've never used Ubuntu or ssmtp. I'm using CentOS 7 for my servers and that comes with postfix by default.

Yes, check the ssmtp documentation to see where it puts its logs.

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) so that you do not lose mail.

Postfix can be configured to send mail via a smarthost like you are doing - just use your zoho.com info in the configuration instead of Gmail.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct