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

Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..
My Blogs - https://code-sample.com and https://code-sample.xyz
My Book1 - BEST SELLING ANGULAR BOOK (INCLUDING ALL VERSIONS 2, 4, 5, 6, 7)
My Book2 - ANGULAR 2 INTERVIEW QUESTIONS BOOK - Both Books are Available on WorldWide.

www.code-sample.com/. Powered by Blogger.