Sending Email via SMTP
Failed to connect to smtp.office365.com:587 [SMTP: Failed to connect socket: php_network_getaddresses: getaddrinfo failed: No such host is known. (code: -1, response: )]
Sending Email via SMTP
That's the correct address. Maybe you have a firewall in place, or a blocked port, or DNS issues, etc. Please contact your server administrator or hosting provider and have them look into it. A good test would be to first ping the hostname from the webserver CLI and if that's successful try to do a telnet to that hostname and port.
Cheers.