Ever tried setting up your email or connecting a new app to Office 365, only to get stuck on “hostname” and “port”? You’re not alone. Knowing your Office 365 hostname and port is essential for smooth email setup, app integrations, and secure connections.

This article breaks down exactly what your Office 365 hostname and port are, why they matter, and guides you step-by-step to find the right information. Get ready for easy, frustration-free setup!

Understanding Your Office 365 Hostname and Port Numbers

If you’re setting up email clients or services that need to communicate with Microsoft 365 (formerly Office 365), one crucial detail you’ll need is your Office 365 hostname and the correct port numbers. Knowing where to find these settings and how they work will help you set up your email or troubleshoot issues smoothly.

Below, you’ll find clear explanations and actionable guidance on how to find your Office 365 (now Microsoft 365) hostname and port, what each setting means, why it matters, and how to apply these details when setting up services or apps.


What is an Office 365 Hostname and Port — And Why Do I Need Them?

When your email client (like Outlook, Apple Mail, or a mobile email app) or a service (like a website contact form or bulk email sender) connects to Microsoft 365, it needs to know two key pieces of information:

  1. Hostname (or server address): This tells your app which server to talk to for sending or receiving emails.
  2. Port number: This is like a “doorway” your client uses to make sure it’s communicating correctly and securely.

Together, these settings ensure your email reaches the right place securely and reliably.


Common Hostnames and Ports for Office 365 (Microsoft 365)

Here’s a quick guide to the most common hostnames and port settings you’ll use:

Email Protocols: What Are They?

Microsoft 365 typically uses three main email protocols:

  • IMAP for receiving email on multiple devices while keeping them in sync
  • POP3 for receiving email locally (less common today)
  • SMTP for sending emails

Let’s break down the hostnames and ports by function:

1. Incoming Mail Server (IMAP/POP3)

  • IMAP Server: outlook.office365.com
  • Port: 993 (SSL/TLS required)
  • POP3 Server: outlook.office365.com
  • Port: 995 (SSL/TLS required)

IMAP is recommended for most users because it enables email syncing across devices.

2. Outgoing Mail Server (SMTP)

  • SMTP Server: smtp.office365.com
  • Port: 587 (STARTTLS encryption required)
  • Port 25 may also be supported but is commonly blocked by ISPs or for security reasons.

Tip: Always use port 587 with STARTTLS when possible. It’s more secure and widely accepted by Microsoft 365.


How to Find Your Specific Microsoft Office 365 Hostname

While the hostnames above work for most standard Microsoft 365 setups, some organizations have custom domains or unique configurations. Here’s how you can confirm your exact hostname settings:

Check in Outlook for Microsoft 365 (Desktop App)

  1. Open Outlook on your desktop.
  2. Go to File > Account Settings > Account Settings.
  3. Select your Microsoft 365 email account.
  4. Click Change.
  5. Check the Server Information section. Here, the Incoming mail server and Outgoing mail server (SMTP) display your current hostnames.

Check in Outlook Web or Microsoft 365 Admin Center

If you’re an admin:

  1. Sign in to the Microsoft 365 admin center.
  2. Go to Settings > Domains.
  3. Select your primary domain to view associated DNS records and mail server settings.

For Advanced Users: Autodiscover

Many modern email clients use something called the Autodiscover service. Just by entering your email address and password, the app can fetch the correct hostname and port settings automatically.

  • Most times, you only need to provide your email address and password, and your client will set everything up for you.

Detailed Email Server Settings for Microsoft 365

Here’s a cheat sheet for setting up your Microsoft 365 email in any app or device:

Function Server/Hostname Port Encryption
IMAP (Incoming) outlook.office365.com 993 SSL/TLS
POP3 (Incoming) outlook.office365.com 995 SSL/TLS
SMTP (Outgoing) smtp.office365.com 587 STARTTLS/TLS
  • Username: Your full Microsoft 365 email address (e.g., [email protected])
  • Password: Your Microsoft 365 account password

Always check whether your account requires additional security steps, such as OAuth2 or app passwords, especially if multi-factor authentication is enabled.


Benefits of Knowing the Correct Hostname and Port

Why does all this matter? Here’s why it’s worth getting right:

  • Reliability: Ensures your email client communicates directly and securely with Microsoft 365.
  • Security: Using the right ports and encryption protects your email login and data.
  • Convenience: Correct settings let you use your favorite email apps rather than being restricted to one platform.
  • Troubleshooting: Knowing these settings helps you fix connection errors quickly.

Common Challenges When Setting Up Office 365 Email Settings

Despite the consistency of Microsoft 365’s mail server details, you might encounter a few bumps along the way:

1. Authentication Issues

  • Some clients may not support the latest authentication required by Microsoft 365.
  • If you use two-factor authentication (2FA), you may need to generate an App Password.

2. Outdated or Custom Domains

  • Older Office 365 tenants or custom setups may have different server addresses.
  • Always check with your IT admin if a standard hostname doesn’t work.

3. Ports Blocked by Network or ISP

  • Some work or public Wi-Fi networks may block ports (especially port 25).
  • Switch to port 587 with TLS/STARTTLS for best compatibility.

4. Legacy Applications

  • Some older apps don’t support modern security protocols (like TLS 1.2), causing connection issues.
  • Upgrade or update your app when possible.

Best Practices for Managing Microsoft 365 Email Server Settings

Follow these tips to make setup, troubleshooting, and maintenance smoother:

1. Document Your Settings

  • Keep a copy of your current email server settings (hostnames, ports, usernames, encryption type) in a safe place.
  • If you’re an admin, provide clear instructions to your team or end users.

2. Use Modern Authentication

  • Whenever possible, use clients and services that support Microsoft’s secure OAuth2 authentication.
  • This boosts security and future-proofs your setup.

3. Avoid Using POP3

  • IMAP is preferred over POP3 because it syncs messages across all your devices.
  • POP3 is best only if you have a very specific reason (e.g., legacy app compatibility).

4. Double-Check Settings After Password Changes

  • Changing your Microsoft 365 password requires you to update it in all email clients.
  • Watch for “Cannot connect” errors after a password update.

5. Test Connections

  • Most email apps let you test your settings before saving them.
  • Use “Test Account Settings” or similar features to verify your setup.

Cost-Saving Tip: Avoid Third-Party Setup Services

You usually do not need to pay extra companies or consultants to set up your Microsoft 365 email in a third-party app. With the tips above, you can do it yourself, or your IT admin can walk you through the process quickly. Save your budget for upgrades or licensed support if truly needed.


Useful Advice for Specific Scenarios

Setting Up Shared Mailboxes

If you’re configuring a shared or delegated mailbox, you may need special permissions (such as “Full Access” or “Send As”) and a separate setup using your main mailbox credentials.

Using Email for Websites or Apps

To send email from a website (for example, via WordPress), use SMTP settings with an authorized Microsoft 365 account and port 587. Ensure the sending mailbox has permissions, and never hardcode your main account password in the website source code.


In Summary

Finding and using the right Office 365 (Microsoft 365) hostname and port is simpler than it looks:

  • IMAP/POP3 Hostname: outlook.office365.com
  • SMTP Hostname: smtp.office365.com
  • IMAP Port: 993 (SSL/TLS)
  • SMTP Port: 587 (STARTTLS/TLS)

While these settings are standard, always double-check based on your organization’s configuration. Using secure ports and settings keeps your communications safe and smooth, whether it’s for your daily Outlook access or integrating email into business apps.


Frequently Asked Questions (FAQs)

1. What is the standard Microsoft 365 (Office 365) hostname for email?

The most common hostnames are outlook.office365.com for incoming email (IMAP or POP3) and smtp.office365.com for sending email (SMTP). These work for the majority of Microsoft 365 users.


2. Which port should I use for sending emails with Microsoft 365?

Use port 587 with STARTTLS encryption when sending emails via SMTP with Microsoft 365. This is more secure and widely accepted than other options. Port 25 is less secure and often blocked.


3. How do I find my company’s specific Microsoft 365 mail server settings?

Check your email app’s account settings, or log into the Microsoft 365 admin center and view your domain’s DNS and mail setup information. If unsure, ask your organization’s IT administrator for the recommended configuration.


4. Can I set up Microsoft 365 email on third-party mail apps and devices?

Yes! Just enter the correct hostnames and ports (as above) into your app. Make sure the app supports the security and authentication methods required by Microsoft 365 for best results.


5. What should I do if I can’t connect to Microsoft 365 mail servers?

Double-check your hostname and port settings. Ensure you’re using your full email address as the username and that your password is current. If using multi-factor authentication, you may need an app password. Also, try a different network in case firewalls are blocking the required ports.


Setting up Microsoft 365 (Office 365) email is straightforward when you know your hostname and port details. With the steps and best practices above, you can get connected—and stay connected—confidently and securely.