I want OJS to send emails. We are on 3.1.1-4 using XAMPP. I installed and set up PHPMailer and can send test emails through Gmail by browsing to a test php page on the localhost, so PHPMailer itself works.
Stupid question: what do I need to do now so OJS sends emails when people register, work on submissions, etc.? The “Email Settings” in config.inc.php is all commented out, so I thought mail() should be working once PHPMailer is installed. Is there one last obvious step I am missing?
If I have ;smtp = on in config.inc.php, SMTP is not used, so mail() should work instead. Where do I need to enter Gmail username and password so OJS can send mail? In C:\xampp\htdocs\journal\lib\pkp\lib\vendor\phpmailer\phpmailer*class.phpmailer.php*?
At the end of the day, I tried to use the example https://pkp.sfu.ca/wiki/index.php?title=Using_gmail_SMTP with a different email address and changed port 587 that I had entered before to 465 and everything started working again. There was no need to try PHPMailer or Sendmail solutions, after all.
My config.inc.php is set up to send via Gmail SMTP servers, but the recepients vary. I created fake submissions using test accounts that have Gmail and Hotmail emails, and I received email confirmations to both of them.
The intent within OJS is for all of the mail configurations to live in config.inc.php. If you enter SMTP configuration here (such as directly to Gmail), OJS will connect directly there. If you turn off SMTP here, then OJS will rely on your server’s native mail handling, via PHP’s mail() function. Many email providers are increasingly depending on compliance with SPF, DKIM, and DMARC standards which require that OJS’s sender be trusted by the recipient. Both Gmail and Yahoo have been early adopters of these standards.
You can find more discussion on this here:
The most recent changes on this are scheduled against 3.1.2: