Should have had enough time to effect some changes, and it looks like a fix is needed in the CNAME? Here's the "name modified" log output.
2023-09-18 18:35:15 Connection: opening to smtp.office365.com:587, timeout=300, options=array()
2023-09-18 18:35:15 Connection: opened
2023-09-18 18:35:15 SERVER -> CLIENT: 220-XX.XXX.XXX.XX.host.SERVER.COM ESMTP Exim 4.96 #2 Mon, 18 Sep 2023 18:35:15 +0000
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
2023-09-18 18:35:15 CLIENT -> SERVER: EHLO
www.sablealturafire.org
2023-09-18 18:35:15 SERVER -> CLIENT: 250--XX.XXX.XXX.XX.host.SERVER.COM Hello
www.SOMEWHERE.org [2603:3:6100:e680::]
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-PIPECONNECT
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
2023-09-18 18:35:15 CLIENT -> SERVER: STARTTLS
2023-09-18 18:35:15 SERVER -> CLIENT: 220 TLS go ahead
2023-09-18 18:35:15 Connection failed. Error #2: stream_socket_enable_crypto(): Peer certificate CN=`-XX.XXX.XXX.XX.host.SERVER.COM' did not match expected CN=`smtp.office365.com' [/home/MOODLESITE/public_html/portal/lib/phpmailer/src/SMTP.php line 468]
2023-09-18 18:35:15 SMTP Error: Could not connect to SMTP host. Connection failed. stream_socket_enable_crypto(): Peer certificate CN=`-XX.XXX.XXX.XX.host.SERVER.COM' did not match expected CN=`smtp.office365.com'
2023-09-18 18:35:15 CLIENT -> SERVER: QUIT
2023-09-18 18:35:15 SERVER -> CLIENT: `
s DUD > 8 221 -XX.XXX.XXX.XX.host.SERVER.COM closing connection
2023-09-18 18:35:15 SMTP ERROR: QUIT command failed: `
s DUD > 8 221 -XX.XXX.XXX.XX.host.SERVER.COM closing connection
2023-09-18 18:35:15 Connection: closed
2023-09-18 18:35:15 SMTP connect() failed.
https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
other event data must be compatible with json encoding
line 747 of /lib/classes/event/base.php: call to debugging()
line 785 of /lib/classes/event/base.php: call to core\event\base->validate_before_trigger()
line 6341 of /lib/moodlelib.php: call to core\event\base->trigger()
line 214 of /local/mailtest/index.php: call to email_to_user()
Thanks to all for their eyes on this, and your help so far!
Rich