How use office365 with ojs 2.4.8?

Hello good morning.

I want try to use office365 with ojs 2.4.8, but don´t work.

My config file is this:

; Use SMTP for sending mail instead of mail()
smtp = On

; SMTP server settings
smtp_server = tls://smtp.office365.com
smtp_port = 587

; Enable SMTP authentication
; Supported mechanisms: PLAIN, LOGIN, CRAM-MD5, and DIGEST-MD5
smtp_auth = PLAIN
smtp_username = mail@domain.com
smtp_password = password

what am I doing wrong?
How can I make it work?

Thanks

Hi @ojs,

I can’t comment on Office365 specifically, but you might try a similar configuration to this known working one for Gmail:
https://pkp.sfu.ca/wiki/index.php?title=Using_gmail_SMTP

Regards,
Alec Smecher
Public Knowledge Project Team

Hi asmecher.

Use gmail account is a goog idea.

But i need use office365 account???

Its possible??

Thanks

Hi @ojs,

It should be possible, but the specifics will depend on what SMTP authentication Office365 supports. I was suggesting that you try using the Gmail configuration specifics to see whether the Office365 server supports the same.

Regards,
Alec Smecher
Public Knowledge Project Team

Hi @asmecher

I try use the gmail configuration with the office365 account, but don´t work.

But when use office365 with othert application in php, work´s fine.

It´s possible a error in ojs code?

Thanks

1 Like

Hi @ojs,

It’s not impossible, but the OJS 2.4.x STMP mailing code is quite stable and has been used by many hosts. I can’t comment on the specific configuration required to work with a particular SMTP provider, as the details will be specific to that provider (authorization type, port number, TLS configuration, etc).

Note that OJS 3.0 uses the PHPMailer library for SMTP delivery, and it’s possible that you can find a PHPMailer configuration for Office365. (OJS 2.4.x uses its own SMTP libraray.)

If you have PHP skills, you could try adding some debugging outputs to lib/pkp/classes/mail/SMTPMailer.inc.php using e.g. the error_log function.

Regards,
Alec Smecher
Public Knowledge Project Team

You don’t use PHPMailer in OJS 3?

My emails used to work fine with OJS 2.4.X but I am having issues since I upgraded to OJS 3

UPDATE: Fixed
Had to sent true parameter Mailer constructor to get mailer Errors(exceptions) and manage to sove the problem by setting a fixed FROM address in Mailer.inc.php class.

1 Like

Hello…

Can you tell me in what file and line did you make that modification?

Thanks