meeting-room-booking-system / mrbs-code

MRBS application code
Other
120 stars 59 forks source link

Can't send mail #2464

Open jberanek opened 5 years ago

jberanek commented 5 years ago

Can't send mail, below is the error message. config is copy from other system. it should correct.

[DEBUG] Bcc: 
2019-05-24 08:28:10 Connection: opening to 192.168.1.4:587, timeout=300, options=array ( 'ssl' => array ( 'verify_peer' => true, 'verify_peer_name' => true, 'allow_self_signed' => false, ),)
2019-05-24 08:28:10 Connection: opened
2019-05-24 08:28:10 SERVER -> CLIENT: 220 mail.Hygon.cn Microsoft ESMTP MAIL Service ready at Fri, 24 May 2019 16:29:16 +0800
2019-05-24 08:28:10 CLIENT -> SERVER: EHLO 192.168.2.100
2019-05-24 08:28:10 SERVER -> CLIENT: 250-mail.server.cn Hello [192.168.1.4]250-SIZE 37748736250-PIPELINING250-DSN250-ENHANCEDSTATUSCODES250-STARTTLS250-AUTH GSSAPI NTLM250-8BITMIME250-BINARYMIME250 CHUNKING
2019-05-24 08:28:10 CLIENT -> SERVER: STARTTLS
2019-05-24 08:28:10 SERVER -> CLIENT: 220 2.0.0 SMTP server ready
2019-05-24 08:28:10 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`*.server.cn' did not match expected CN=`192.168.1.4' [/var/www/html/mrbs/web/lib/PHPMailer/class.smtp.php line 375]
SMTP Error: Could not connect to SMTP host.
2019-05-24 08:28:10 CLIENT -> SERVER: QUIT
2019-05-24 08:28:10 SERVER -> CLIENT: 
2019-05-24 08:28:10 SMTP ERROR: QUIT command failed: 
2019-05-24 08:28:10 Connection: closed
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
[DEBUG] Failed to send email: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Reported by: *anonymous

Original Ticket: mrbs/support-requests/1762

jberanek commented 5 years ago

Is it because you've specified the mail server by IP address when you'd need to specicfy by name so that it matches the SSL certificate of the mail server?

Original comment by: ahar23