My client switched to Office365, so I have to set up the SMTP in MODX to make the forms work.
But mail is not sent. The form keeps spinning for a while, then reloads, then nothing (the filled in fields are still filled in). No autoResponse, no mails, no redirect page, no nothing.
My snippet is:
[[!FormIt?
&hooks=recaptchav2,hook.RampartFormIt,spam,email,FormItAutoResponder,redirect
&submitVar=contactForm-submit
&emailTpl=form-contact-sentEmailTpl
&emailSubject=Een bericht van [[+contact_name]]
&emailToName=Company Name
&emailTo=[email protected]
&emailFrom=[email protected]
]]
Strange thing is: if I set mail_smtp_auth and mail_use_smtp to ânoâ, it works fine. How is that supposed to work?
If youâre setting âmail_use_smtpâ to no, itâs using the web hosts internal mail system instead, side-stepping the whole SMTP set up so all SMTP-related problems would vanish but youâre also losing the benefits of SMTP sending.
+1 to using the QuickEmail snippet. Add the âdebugâ to that and youâll have the best chance to discover a world of helpful information to trouble shoot the specific set up with the SMTP option.
Office / Microsoft 365, like a number of other email systems, require that you configure the SMTP relay on the servers. Without this, the SMTP relay is rejected and you cannot send your email from your application.
In Office 365 (which uses a Microsoft Exchange server), this is setup is called âconnectorsâ. To configure this, go to the Office 365 Admin center, then select the Microsoft Exchange admin center and select the âMail Flowâ => âConnectorsâ option. On this page, there is a link to some help documents from Microsoft regarding the setup of an appropriate connector.
I am not sure why I should check settings in Office 365. My client uses Office 365 through a dedicated company. I cannot access any of these settings. It has nothing to do with their website which is done by me.
Because youâre sending emails through their SMTP server (or relay). To allow emails to go through, both parties need to be aligned.
Have you tried debugging with QuickEmail yet? Thatâs very good at pinpointing authentication or other errors. It can also tell you that sending worked correctly, meaning the problem is on the receiving end instead.
Install the extra and place the following on a resource:
[[!QuickEmail? &debug=`1`]]
Another great tool for debugging email deliverability issues (i.e. quickemail reports a successful send, but it doesnât arrive) is mail-tester.com. That will test your SPF, DKIM and DMARC settings, analyse its spam score, check blacklists and a bunch more.
Easy to test again with QuickEmail.
[[!QuickEmail? &debug=`1` &to=`<email provided by mail-tester.com>`]]
That suggests it canât reach the SMTP server thatâs configured. In my experience a timeout suggests the wrong port or connection prefix.
Itâs best to ask the email admins what settings to use, or you can try different combinations and maybe get lucky by stumbling across the right configuration:
port 465 instead of 587
ssl instead of tls for the connection prefix
When the quickemail output changes, you know youâre heading in the right direction.
Or like @jcreiss suggests outside SMTP access may first need to be enabled by the email admin with a relay or connector. Itâs definitely best to talk to them to find out the required configuration to put in MODX.
Yes, the one Iâm using. So Iâm a bit clueless right now.
This is not the first time I am encountering problems with Office 365; most of these email providers âforgetâ that there is hosting with existing email accounts still live, or contact forms on websites, etc.