Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`mail.icar.gov.in' did not match expected CN=`00.000.0.000'

I am using OJS 3.3.0.10 and unable to send mail through mail server and host provider is not enabling the Gmail port.
he restrict to use local SMTP port for mail but if we trying to send mail through local SMTP then below error was appear.
please help to solve this problem

Mail Config
mail confi

Sending mail error
mail error

Currently i am facing this issue please suggest how to solve this.
we are trying to solve past 2 weeks but unable to do.
please help

Error log
[24-Mar-2022 16:16:00 Asia/Kolkata] Connection: opening to 10.100.3.109:25, timeout=300, options=array()
[24-Mar-2022 16:16:00 Asia/Kolkata] Connection: opened
[24-Mar-2022 16:16:00 Asia/Kolkata] SERVER → CLIENT: 220 SRDELEXG05.ICAR.GOV.IN Microsoft ESMTP MAIL Service ready at Thu, 24 Mar 2022 16:17:00 +0530

[24-Mar-2022 16:16:00 Asia/Kolkata] CLIENT → SERVER: EHLO epubs.icar.gov.in

[24-Mar-2022 16:16:00 Asia/Kolkata] SERVER → CLIENT: 250-SRDELEXG05.ICAR.GOV.IN Hello [10.100.3.131]
250-SIZE 31457280
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-8BITMIME
250-BINARYMIME
250 CHUNKING

[24-Mar-2022 16:16:00 Asia/Kolkata] CLIENT → SERVER: STARTTLS

[24-Mar-2022 16:16:00 Asia/Kolkata] SERVER → CLIENT: 220 2.0.0 SMTP server ready

[24-Mar-2022 16:16:00 Asia/Kolkata] Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=mail.icar.gov.in' did not match expected CN=10.100.3.109’ [/EPUB/ojs/lib/pkp/lib/vendor/phpmailer/phpmailer/src/SMTP.php line 455]
[24-Mar-2022 16:16:00 Asia/Kolkata] SMTP Error: Could not connect to SMTP host.
[24-Mar-2022 16:16:00 Asia/Kolkata] CLIENT → SERVER: QUIT

[24-Mar-2022 16:16:00 Asia/Kolkata] SERVER → CLIENT:
[24-Mar-2022 16:16:00 Asia/Kolkata] SMTP ERROR: QUIT command failed:
[24-Mar-2022 16:16:00 Asia/Kolkata] Connection: closed
[24-Mar-2022 16:16:00 Asia/Kolkata] SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub
[24-Mar-2022 16:16:00 Asia/Kolkata] SMTP connect() failed. Troubleshooting · PHPMailer/PHPMailer Wiki · GitHub

have you try this setting?

smtp_server = mail.icar.gov.in

If we are using smtp_server = mail.icar.gov.in then Error was Connection failed. Error #2: stream_socket_client(): unable to connect to mail.icar.gov.in:25 (connection time out)

Probably your server can’t connect to port 25. Ask your sysadmin to check your firewall, please.

We are using third party SMTP server and i have configured postfix and then send mail but mail was not sent. Only error was change and now Error is SMTP Error: Could not authenticate.
I have confirmed my port, username and password is correct and we have implemented SSL but it is showing “not secure”.
Please suggest if anything is missing.

Error screenshot
mail error ojs

Solved above problem with postfix.

This topic was automatically closed after 3 days. New replies are no longer allowed.