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

**URL:** <https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743>\
**Category:** Product Support\
**Created:** [November 20, 2019, 5:47pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743 "2019-11-20T17:47:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [November 20, 2019, 5:47pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/1 "2019-11-20T17:47:48Z")

</div>

**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](http://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](http://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](http://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](http://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.

---

<div class="post-metadata">

**Author:** ![MxyzptlkFishStix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mxyzptlkfishstix/32/1132_2.png) [@MxyzptlkFishStix](https://forum.mautic.org/u/MxyzptlkFishStix)\
**Post date:** [November 20, 2019, 6:25pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/2 "2019-11-20T18:25:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [November 20, 2019, 9:21pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/3 "2019-11-20T21:21:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![MxyzptlkFishStix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mxyzptlkfishstix/32/1132_2.png) [@MxyzptlkFishStix](https://forum.mautic.org/u/MxyzptlkFishStix)\
**Post date:** [November 20, 2019, 10:09pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/4 "2019-11-20T22:09:40Z")

</div>

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](http://dpaste.com/39CJE73).  
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.

---

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [November 20, 2019, 10:46pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/5 "2019-11-20T22:46:42Z")

</div>

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](http://smtp.office365.com) [#0] Log data: ++ Starting Swift\_SmtpTransport !! Connection could not be established with host [smtp.office365.com](http://smtp.office365.com) [#0] (code: 0)

---

<div class="post-metadata">

**Author:** ![mauticuser1](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mauticuser1/32/422_2.png) [@mauticuser1](https://forum.mautic.org/u/mauticuser1)\
**Post date:** [November 20, 2019, 10:54pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/6 "2019-11-20T22:54:26Z")

</div>

I’m reading another post that says:

> [@Office365 SMTP](https://forum.mautic.org/t/office365-smtp/10663):
>
> Not sure I am posting to the right place. I am trying to setup mautic to send mail via SMTP using Office365. As far as I can tell the settings are correct but I cannot send emails. I get error “Client does not have permissions to send as this sender”. Test Connection Works but email send fails. Anyone has any experience with getting Office365 to work with mautic ? Other SMTP works fine. The settings I have are [smtp.office365.com/587/TLS/SMTP](http://smtp.office365.com/587/TLS/SMTP) mode :login

“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”

---

<div class="post-metadata">

**Author:** ![MxyzptlkFishStix](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/mxyzptlkfishstix/32/1132_2.png) [@MxyzptlkFishStix](https://forum.mautic.org/u/MxyzptlkFishStix)\
**Post date:** [November 20, 2019, 11:10pm UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/7 "2019-11-20T23:10:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Yosu\_Cadilla](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/yosu_cadilla/32/6206_2.png) [@Yosu\_Cadilla](https://forum.mautic.org/u/Yosu_Cadilla)\
**Post date:** [November 21, 2019, 2:09am UTC](https://forum.mautic.org/t/mail-send-setting-using-office365-website-hosted-on-local-windows-server/11743/8 "2019-11-21T02:09:09Z")

</div>

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:

> **[Mautic Hosting: Mautic Self Hosted Best Practices | mauteam.org](https://mauteam.org/mautic/mautic-admins/mautic-hosting-mautic-self-hosted-best-practices/)**
>
> Mautic will run on any server that supports PHP and a MySQL compatible database, which is little short of saying it will run anywhere, you could run it on Linux, Windows, you could run it on your…

  

> **[Mautic email: Which email provider is best for Mautic? | mauteam.org](https://mauteam.org/mautic/mautic-users/mautic-email-which-email-provider-is-best-for-mautic/)**
>
> Mautic can do a whole lot of smart stuff for your email, except sending it! Mautic users have to use a third party service to send emails, in this post I’ll go over 3 different options for sending…
