WebSite X5Help Center

 
Mario G.
Mario G.
User

Contactsheet: smtp connect() failed after Migration to Microsoft365  en

Autore: Mario G.
Visite 69, Followers 1, Condiviso 0  

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:///admin) is somehow also not useable anymore [not sure if this is a license thing..] 


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
  

Postato il
12 RISPOSTE
Incomedia
Eric C.
Incomedia

Hello Mario,
what issue are you encountering when trying to access the Control Panel, exactly?
I remain available.

Leggi di più
Postato il da Eric C.
Mario G.
Mario G.
User
Autore

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 ? 

Leggi di più
Postato il da Mario G.
Incomedia
Eric C.
Incomedia

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.

Leggi di più
Postato il da Eric C.
Mario G.
Mario G.
User
Autore

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  :-(

Leggi di più
Postato il da Mario G.
Mario G.
Mario G.
User
Autore

Gotcha !  this works !  thx

So which of the following options should be used  primarily ? PHP SMTP with Logon ?

Leggi di più
Postato il da Mario G.
Incomedia
Eric C.
Incomedia

Hello Mario,
this depends on what configuration your provider recommends, commonly SMTP or Authenticated SMTP are suggested.

Leggi di più
Postato il da Eric C.
Mario G.
Mario G.
User
Autore

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 

Leggi di più
Postato il da Mario G.
Mario G.
Mario G.
User
Autore

addendum:  

I found something, that I might have to allow SMTP in MS365 Admin settings ?  I`ll check this ....

Leggi di più
Postato il da Mario G.
Mario G.
Mario G.
User
Autore

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

Leggi di più
Postato il da Mario G.