Mail Send Setting using office365, website hosted on local windows server

Your software
My Mautic version is: Mautic 2.12.3
My PHP version is: PHP Version 7.2.7
Windows Server 2012 R2 Standard Edition

My problem is: Can not get a good Test Connection, Can not Send Test Email

I configured the email settings - Host - smtp.office365.com, Port - 587, Encry - TLS and Auth - Login, when I click on Test connection, it gives the following error -
Connection could not be established with host smtp.office365.com [An attempt was made to access a socket in a way forbidden by its access permissions. #10013] Log data: ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.office365.com [An attempt was made to access a socket in a way forbidden by its access permissions. #10013] (code: 0)

When i send test email this is my error log:
Connection could not be established with host smtp.office365.com [An attempt was made to access a socket in a way forbidden by its access permissions. #10013]

Steps I have tried to fix the problem:
Verified port 587 is open on server machine, Verified using correct username/password by logging into email at office365. Domain name hosted my GoDaddy, spoke with support there to get email settings.

Error #10013 - Outbound access to the port is blocked by GoDaddy.

You have to tell them specifically which ports to open for outbound access as they block them all by default, even on VPS and dedicated platforms. This has been a known issue with GD for years.

Thanks for your suggestion. I spoke with a GD rep and they seem not to know what I’m talking about. Said they do not have ports to control.

Just to clarify, my website and my Mautic installation is on a local windows server. I used Port scan to check that port 587 is in fact open. I logged into office365 to verify my username/password.

You’re not the first Mautic user that has ever used GoDaddy on here. Shared hosting plans are not allowed to make outbound connects to ports 25, 465 and 587 and can only relay via relay-hosting.secureserver.net. VPS and dedicated server plans are allowed but are blocked by default. A port scan is not going to show that outbound traffic is blocked. It only shows that the ports are open from the outside of your machine.

Contact GD again and tell them to elevate your support ticket to a higher tier support person.

To test your outbound connection to ports on Office365, do the following.

Create a file in the root of a website running on your server named port-checker.php
Copy and paste the code from this link.
Save it and open a link to it in your browser e.g. https://example.com/port-checker.php.

Green means there’s nothing preventing you from connecting to Office365. Red means you’re blocked by GD.

1 Like

OK, thanks. got a green on port 25, red on port 587

updated my port to 25, now i get a different error -
Connection could not be established with host smtp.office365.com [ #0] Log data: ++ Starting Swift_SmtpTransport !! Connection could not be established with host smtp.office365.com [ #0] (code: 0)

I’m reading another post that says:

“Found the solution : instead of smpt.office365,com use the .outlook.com smtp server. Find this in the Office365 console. Use port 25, not 587. set to SSL. this will allos intenral dmaon emails to work. Next setup a connected in Office365 to allow external emails from the webservers IP”

As I stated from the get-go, outbound traffic is blocked to port 587 from your server. However, you can use port 25 for encrypted SMTP as STARTTLS is running on it.

I understand you want to keep costs low, however hosting Mautic on your own computer is a no go, a cloud VPS will cost you as low as $10/month or even $5/month.

Another no-go is to use your residential or company email service for sending emails.
You need to use an email marketing service. There are a few mid-quality marketing email providers that offer you lots of free emails per month. If you are not sending that many emails, Sendgrid is top quality provider and will give you 2K emails for free each month.

Amazon SES offers you 65K emails for free each month, coupled with the free tier, you can get Mautic running for no cost at all for an entire year.

I’m already working on a guide about how to run Mautic for zero $, in the meantime, here are 2 other posts you might find useful: