SMTP Settings Outlook365 and Gmail

SMTP Settings for Outlook365 and Gmail

What are the SMTP settings for Office 365?
What is the mail server for Outlook?
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. [email protected])

IMAP Server Settings

The following are the incoming and outgoing IMAP server settings for Office 365.
SettingIMAP (incoming)SMTP (outgoing)
Server Nameoutlook.office365.comsmtp.office365.com
Port Number993587
Encryption MethodSSLTLS

Example - C# code looks like

// C#
using (Imap client = new Imap())
{
    client.ConnectSSL("outlook.office365.com");
    client.UseBestLogin("[email protected]", "your-password");
    ...
}

using (Pop3 client = new Pop3())
{
    client.ConnectSSL("outlook.office365.com");
    client.UseBestLogin("[email protected]", "your-password");
    ...
}

using (Smtp client = new Smtp ())
{
    client.Connect("smtp.office365.com");
    client.StartTLS();

    client.UseBestLogin("[email protected]", "your-password");
    ...
}

Reference -

I hope you are enjoying with this post! Please share with you friends. Thank you so much!
ANIL SINGH

Hey! I'm Anil Singh. I author this blog. I'm Active Blogger, Programmer. I love learning new technologies, programming, blogging and participating the forum discussions more...
My Blogs - https://code-sample.com and https://code-sample.xyz
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like
Post a Comment
www.code-sample.com/. Powered by Blogger.
ASK Questions
SQL Server NodeJs TypeScript JavaScript Angular SQL Server My Book