I've a dedicated server for sending emails with different domain and I'm running nginx and php on the ubuntu server. I've configured ssmtp to send emails which is working fine from terminal using echo from terminal. I want to use php mail function to send mails from the server and I'm using ssmtp. How can I do that? I've made changes in php.ini file in php fpm directory as follows:
smtp_port = 25
sendmail_from = noreply@instaclasses.info
sendmail_path = /usr/sbin/ssmtp
mail.add_x_header = On
I need to configure the php mail function so that any mail sent from mail function is sent from default smtp server configured already.