My mail configuration is fully set up and working correctly, including the SMTP.However, when sending emails from the system, they are sent from my Gmail address (used when creating the first admin account) instead of admin@mydomain.com, which is defined in the mail configuration.
I’m using OJS version 3.5.0.1 also I’ve seen the mailer.php fix, tried it but I guess didn’t work.
How can I make OJS send all outgoing emails using the domain email address instead of the Gmail one?
Thank you for your reply, but I don’t use Gmail services. While installing the website, ( in config.ini.php file) I used my own smtp server. which is mail.myowndomain.com, set the smtp port and everything else.
But when I created the admin account, which is under my name and included my own personal Gmail adress, I realized all the mails from the journal to users or readers is sent under my personal gmail account.
This is the problem, I did not write down the Gmail SMTP, it’s my own host. The “from address” part is not working properly.
As @asmecher said, google (and many other commercial domain mail providers) does not allow arbitrary From addresses… but your own mail server may be more lenient in this regard.
In any case, it is not clear what your actual OJS settings are. In my experience, with these settings
allow_envelope_sender = On
default_envelope_sender = noreply@example.com
force_default_envelope_sender = On
force_dmarc_compliant_from = On
in OJS 3.x, the From field is always noreply@example.com, and the Reply-To is the email of the user who sent the email through the OJS. You may also want to tweak dmarc_compliant_from_displayname.
I mentioned gmail mostly for the benefit of the other people who may stumble upon this post. The thing is, with your own mail server you can configure it however you like, and in your case your mail server allowed custom From addresses and all your emails got through even with force_dmarc_compliant_from = off. But many commercial mail providers do not allow this behavior at all, and so they are likely to reject the emails with the “wrong” From header. So this is a possible solution to the “OMG my OJS doesn’t send emails and I don’t know why” kind of issue for those who are using external mail services that they have no control of.