An email error occurred:SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

May you have the correct email setting.
But the problem comes from “selinux”, disabled to fix. https://linuxize.com/post/how-to-disable-selinux-on-centos-7/