WebSite X5Help Center

 
Mario G.
Mario G.
User

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

Auteur : Mario G.
Visité 100, Followers 1, Partagé 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
  

Posté le
13 RéPONSES - 1 UTILES
Incomedia
Eric C.
Incomedia

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

Lire plus
Posté le de Eric C.
Mario G.
Mario G.
User
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 ? 

Lire plus
Posté le de 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.

Lire plus
Posté le de Eric C.
Mario G.
Mario G.
User
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  :-(

Lire plus
Posté le de Mario G.
Mario G.
Mario G.
User
Auteur

Gotcha !  this works !  thx

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

Lire plus
Posté le de Mario G.
Incomedia
Eric C.
Incomedia

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

Lire plus
Posté le de Eric C.
Mario G.
Mario G.
User
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 

Lire plus
Posté le de Mario G.
Mario G.
Mario G.
User
Auteur

addendum:  

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

Lire plus
Posté le de Mario G.
Mario G.
Mario G.
User
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

Lire plus
Posté le de Mario G.
Daniel W.
Daniel W.
User
Meilleur utilisateur du mois DEMeilleur utilisateur du mois EN

(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 ***.

Lire plus
Posté le de Daniel W.