I isntalled successfull ssmtp:
/etc/ssmtp/ssmtp.conf
[email protected]
[email protected]
mailhub=ssl0.ovh.net:587
#mailhub=ns0.ovh.net:587
UseSTARTTLS=YES
FromLineOverride=YES
[email protected]
AuthPass=********
And trying it with:
echo content | mail -s "subject" [email protected]
This works and I do receive email
my ssmpt seems also ok:
ls -la /usr/sbin/sendmail
lrwxrwxrwx 1 root root 5 Jul 15 2014 /usr/sbin/sendmail -> ssmtp
my php.ini has:
sendmail_path = "/usr/sbin/sendmail -t -i"
However, when I try to send email through the mail() function: I receive FALSE
tail /var/log/apache2/error.log
gives me: sendmail: Cannot open mailhub:25
Any idea ?
It looks like ssmtp doesn't support the
-i
argument, and requires-oi
instead. Note that-oi
means the same thing and should work on other sendmail implementations.Could you try changing your sendmail command to
/usr/sbin/sendmail -t -oi
?ssmtp manpage at: https://linux.die.net/man/8/ssmtp.