phpmailer issue - smtp.office365.co.uk connection failed - smtp

I a, having issues with my phpmailer establishing a connection to office365
Can anybody help me debug this?
Thanks
2020-04-30 16:07:03 Connection: opening to ssl://smtp.office365.com:587, timeout=30, options=array ( )
2020-04-30 16:07:03 Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:1408F10B:SSL routines:ssl3_get_record:wrong version number [/home/useraccount/public_html/hr/application/third_party/phpmailer/class.smtp.php line 293]
2020-04-30 16:07:03 Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/useraccount/public_html/hr/application/third_party/phpmailer/class.smtp.php line 293]
2020-04-30 16:07:03 Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.office365.com:587 (Unknown error) [/home/useraccount/public_html/hr/application/third_party/phpmailer/class.smtp.php line 293]
2020-04-30 16:07:03 SMTP ERROR: Failed to connect to server: (0)
2020-04-30 16:07:03 SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

Firstly, you are using an old version of PHPMailer, so get the latest version.
You have a TLS error because you're using ssl mode on a port expecting tls encryption mode, so change your code to this:
$mail->Host = 'smtp.office365.com';
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
Read the docs the error message points you at, since this exact problem is covered in detail.

Related

XAMPP phpmyadmin error list Cannot connect: invalid settings, Packets out of order, mysqli::real_connect(): Error while reading greeting packet etc

I got following errors when I start the server. I did not changed any password or username before stop the xampp and shutdown the computer.
Cannot connect: invalid settings.
Packets out of order. Expected 0 received 1. Packet size=68
mysqli::real_connect(): Error while reading greeting packet. PID=5140
mysqli::real_connect(): (HY000/2006): MySQL server has gone away
Connection for controluser as defined in your configuration failed.
Packets out of order. Expected 0 received 1. Packet size=68
mysqli::real_connect(): Error while reading greeting packet. PID=5140
mysqli::real_connect(): (HY000/2006): MySQL server has gone away
phpMyAdmin tried to connect to the MySQL server, and the server rejected the connection. You should check the host, username and password in your configuration and make sure that they correspond to the information given by the administrator of the MySQL server.
Update:
when I changed the $cfg['Servers'][$i]['AllowNoPassword'] = true; to false; now only shows following error
phpMyAdmin tried to connect to the MySQL server,
and the server rejected the connection.
You should check the host, username and password in your configuration and make sure that
they correspond to the information given by the administrator of the MySQL server.

Facing a SMTP ERROR on phpmailer all of a sudden

My PHPMAILER script has been working fine until couple days ago with the following message - nothing has changed as far as I am aware
Any idea ?
Thanks
SSL loaded Server -> Client: +OK <30126.1635064119#pop.w14.httpserveur.net> Server -> Client: +OK Server -> Client: +OK Server -> Client:
debug level 3; message: Connection: opening to ssl://46.105.44.1:465, timeout=300, options=array()
debug level 3; message: Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed [/home/clients/cineferte.fr/http/mail/phpmailer/phpmailer/src/SMTP.php line 394]
debug level 3; message: Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/clients/cineferte.fr/http/mail/phpmailer/phpmailer/src/SMTP.php line 394]
debug level 3; message: Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://46.105.44.1:465 (Unknown error) [/home/clients/cineferte.fr/http/mail/phpmailer/phpmailer/src/SMTP.php line 394]
debug level 1; message: SMTP ERROR: Failed to connect to server: (0)
debug level 3; message: SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Message could not be sent. Mailer Error: SMTP connect() failed.

SMTP ERROR: Failed to connect to server: Connection refused (111)

I am using https://bootstrapious.com/p/how-to-build-a-working-bootstrap-contact-form example index-3.html, contact-3.php, contact-3.js. Getting error 'SMTP ERROR: Failed to connect to server: Connection refused (111). I tried 1) smtp port 465 with SMTPSecure ssl 2) smtp port 587 SMTPsecure tls 3) smtp port 25. But not able to send mail. Kindly suggest solution.

Getting error:Peer authentication failed while connecting octave to psql database

I am trying to connect to a psql database from octave but getting a peer authentication failed error.
error: FATAL: Peer authentication failed for user
error: PQ connection attempt failed
check your pg_hba.conf file I think in that file there is no entry of your current user.
or see the link

reproduce Got an error reading communication packets in Mysql

How to reproduce the MySQL error "Got an error reading communication packets in MySQL" in MySQL error log. and what will happen to that connection. So that the MySQL will produce 2013 error..
Thanks in advance.
Change the bind-address="Some IP" restart MySQL server and try to start from localhost, you will get this error.
This error also occurs if port forwarding is disabled in SSH configuration (the configuration parameter 'AllowTcpForwarding' is set to 'no' in the 'sshd_config' file)