2

I isntalled successfull ssmtp:

/etc/ssmtp/ssmtp.conf

root=contact@mydomain.com
www-data=contact@mydomain.com
mailhub=ssl0.ovh.net:587
#mailhub=ns0.ovh.net:587
UseSTARTTLS=YES
FromLineOverride=YES
AuthUser=contact@mydomain.com
AuthPass=********

And trying it with:

 echo content | mail -s "subject" myemail@gmail.com

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 ?

yarek
  • 191

1 Answers1

0

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.

thomasrutter
  • 37,804