What are the SMTP settings for Office 365?
To send emails we will need to configure the SMTP settings-
Office365 with SSL -
SMTP Server: This should be your mail server name. (e.g. smtp.office365.com)
SMTP Security: Enable SSL
Port: 995
Office365 with TLS -
SMTP Server: This should be your mail server name. (E.g., smtp.office365.com)
SMTP Security: Enable TLS
Port: 587
Gmail -
SMTP Server: smtp.gmail.com
Port: If SSL is enabled use Port 465. If TLS is enabled use Port 587.
Auth Username: This will be your full Gmail address. (e.g. anil.singh581@gmail.com)
IMAP Server Settings
The following are the incoming and outgoing IMAP server settings for Office 365.Setting | IMAP (incoming) | SMTP (outgoing) |
---|---|---|
Server Name | outlook.office365.com | smtp.office365.com |
Port Number | 993 | 587 |
Encryption Method | SSL | TLS |
Example - C# code looks like
// C# using (Imap client = new Imap()) { client.ConnectSSL("outlook.office365.com"); client.UseBestLogin("admin@your-domain.com", "your-password"); ... } using (Pop3 client = new Pop3()) { client.ConnectSSL("outlook.office365.com"); client.UseBestLogin("admin@your-domain.com", "your-password"); ... } using (Smtp client = new Smtp ()) { client.Connect("smtp.office365.com"); client.StartTLS(); client.UseBestLogin("admin@your-domain.com", "your-password"); ... }
I hope you are enjoying with this post! Please share with you friends. Thank you so much!