I'm hosting two websites created with wordpress on a server.
Those website should be able to send mails to users, but it fails for almost receivers (except maybe gmail).
I found that the problem was that the mails was sent by the user www-data@myserver
and were rejected.
I would like to configure my php.ini
to use /usr/sbin/sendmail -f
to provide a from
value so that the emails would have a valid domain.
My problem is how to be able to specify multiple domains here so that each website would send mail with an address like [email protected]
with mydomain
matching to each website's one.
I saw I could use php's mail()
and provide an argument with -f
but it is deprecated before wordpress wp_mail()
's function.
How can I achieve what I want ?
Just create email accounts for each WordPress and set it up to use SMTP to send emails using real email accounts.
WordPress does support this natively.