Contactsheet: smtp connect() failed after Migration to Microsoft365 
Auteur : Mario G.Hi Community,
after switching my mail provider away from website hoster to MS365, the contact form mail notification does no longer work; email_log.txt reports
"SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting"
(before migration, contact form was using "PHP Mailer" and mail server from website hoster, which was o.k.)
The receiving mail account(s) are working fine on MS365; on hoster side, the MX records were also set accordingly;
Of course I`ve checked / adapted the mail communication parameters in X5 to "SMTP -Authentication"; multiple times, but nothing changes...
Using the build-in admin-function (https://
How can I increase the tracelevel / verboselevel of the php-scripts to obtain a more detailed email_log ?
help is much appreciated..
thx
br
Mario
Hello Mario,
what issue are you encountering when trying to access the Control Panel, exactly?
I remain available.
Auteur
Hi,
haven`t used it in a while , so I`m not sure about the URL; isn`t it http://domain/admin ?
this URL leads to 403 Forbidden;
maybe I`m simply using a wrong URL ?
Hello,
yes, that should be the format.
Usually an error 403 refers to incorrectly set restrictions or permissions, what is the URL of your website?
I remain available.
Auteur
addendum

when call the X5 Menu "Control Panel" , an Ad with Website X5 Pro comes up
looks like the Control Panel is only available in ProEdition :-(
Auteur
https://silar.at
Please check with the full URL for the login to the admin panel, https://silar.at/admin/login.php
Unlike https://silar.at/admin (which is normally available and redirects to the other address) this does not show a Forbidden error.
Auteur
Gotcha ! this works ! thx

So which of the following options should be used primarily ? PHP SMTP with Logon ?
Hello Mario,
this depends on what configuration your provider recommends, commonly SMTP or Authenticated SMTP are suggested.
Auteur
Hi Eric,
I tried PHP SMTP with Logon , because that`s the only option where I can give logon credentials;
but again same result : [2025-09-18 17:24:05] SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
The mail provider is Microsoft 365, so the following setting shoud apply: https://support.microsoft.com/en-au/office/pop-imap-and-smtp-settings-for-outlook-com-d088b986-291d-42b8-9564-9c414e2aa040
I have tried both servers, smtp-mail.outlook.com and smtp.office365.com, the test take 2-3 sec to complete; but same result ;
this bings me back to my origin question; can I somehow increase the loglevel ? maybe there`s a qualified response from MS365
Auteur
addendum:
I found something, that I might have to allow SMTP in MS365 Admin settings ? I`ll check this ....
Auteur
in fact, there seems to be such a setting in MS365

found here(DE): https://kinsta.com/de/wissensdatenbank/office-365-smtp
tested again: no changes (up to now) ; I`ll continue tomorrow ..
Auteur
SOLVED (at least for me) !!
the more I dug into MS365 docu, the more obvious it appeared, that Microsoft does not really "want"
SMTP AUTH; even worse: they see it as outdated and not secure ! check following article related to MS Entra ID Security: https://learn.microsoft.com/de-de/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission
So I´ve decided to go with a workaround:
- I`ve created a new permanent forwarding email alias (on my old hosting mail server) e.g. webmail@mydomain
- then I`ve established a permanent forwarding to the *onmicrosoft.com alias mail adress
- In X5, I`m continuing to use the recommended PHP Mailer Script (with different parameters)
- I`ve re-activated MS Entra Security level to recommended default
Result: the HP Mailer Script contacts the local mail server from hosting provider; then a (synchronious?) redirect to *onmicrosoft.com is performed; mail is not persisted in between, so no cleanup required;
Maybe this helps the community in case of similar MS365 issues;
@Incomedia: maybe you should consider to "modernize" the mailing capabilities to comply with the more restrictive security requirements coming with Microsoft365 ?
that`s it
bye
Mario
(de > en) Most web hosts require the use of the customer's email domain if emails are to be sent via the website using scripts.
Forwarding to email addresses such as Gmail etc. must be done via the customer area.
Example:
Website: my-website.com
E-mail address: contact(at)my-website.com
Note: The (at) must be replaced with @. The (at) must be used in email addresses here in the community; otherwise, email addresses will be displayed as ***.