Outlook: IMAP, POP3, and SMTP settings
Outlook.com supports access via POP3 and SMTP protocols. Below you can find the
configuration settings for those protocols.
All Outlook.com servers (POP3 and SMTP) use implicit SSL (use ConnectSSL method).
SMTP server also supports explicit SSL (you can use Connect method and then secure
the channel using StartTLS method)
IMAP
Server: imap-mail.outlook.com
SSL: true-implicit
Port: 993 (default)
User: [email protected]
POP3
Server: pop-mail.outlook.com
SSL: true-implicit
Port: 995 (default)
User: [email protected]
POP access must be turned on via web interface.
In the web interface click “gear icon” in the top, right corner, then select
“Options”.
Depending on the UI version:
On the options pane click “Mail/Accounts/POP and IMAP”. In the “POP options”
section select “Yes”.
-or-
On the options pane click “Connect devices and apps with POP” link. In the “POP”
section mark “Enable”.
SMTP
Server: smtp-mail.outlook.com
SSL: true-explicit
Port: 587 (default)
User: [email protected]
Following are the code samples for Mail.dll .NET IMAP, POP3 and SMTP component.
// C#
using (Imap client = new Imap())
{
client.ConnectSSL("imap-mail.outlook.com");
client.UseBestLogin("
[email protected]", "password");
...
}
using (Pop3 client = new Pop3())
{
client.ConnectSSL("pop-mail.outlook.com");
client.UseBestLogin("
[email protected]", "password");
...
}
using (Smtp client = new Smtp ())
{
client.Connect("smtp-mail.outlook.com");
client.StartTLS();
client.UseBestLogin("
[email protected]", "password");
...
}
' VB.NET
Using client As New Imap()
client.ConnectSSL("imap-mail.outlook.com")
client.UseBestLogin("
[email protected]", "password")
...
End Using
Using client As New Pop3()
client.ConnectSSL("pop3-mail.outlook.com")
client.UseBestLogin("
[email protected]", "password")
...
End Using
Using client As New Smtp()
client.ConnectSSL("smtp-mail.outlook.com")
client.StartTLS();
client.UseBestLogin("
[email protected]", "password")
...
End Using
https://www.limilabs.com/blog/outlook-imap-pop3-smtp-settings
https://support.microsoft.com/en-us/office/pop-imap-and-smtp-settings-for-outlook-
com-d088b986-291d-42b8-9564-9c414e2aa040
Send Email using ASP.Net VB.Net
<%@ Page Language="VB" %>
<%@ Import Namespace="System.Net.Mail" %>
<script runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs)
Dim strTo = "
[email protected]"
Dim MailMsg As New MailMessage(New MailAddress(strFrom.Trim()), New
MailAddress(strTo))
MailMsg.BodyEncoding = Encoding.Default
MailMsg.Subject = "This is a test email using VB.Net Code"
MailMsg.Body = "This is a test email using VB.Net Code"
MailMsg.Priority = MailPriority.High
MailMsg.IsBodyHtml = True
Dim SmtpMail As New SmtpClient
Dim basicAuthenticationInfo As New
System.Net.NetworkCredential("
[email protected]", "password")
SmtpMail.Host = "smtp.yourdomain.com"
SmtpMail.UseDefaultCredentials = False
SmtpMail.Credentials = basicAuthenticationInfo
SmtpMail.Send(MailMsg)
lblMessage.Text = "Mail Sent"
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:Label id="lblMessage" runat="server"></asp:Label>
</form>
</body>
Send Mail Using CDO
<%
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "[email protected]"
objEmail.To = "[email protected]"
objEmail.Subject = "Test Mail"
objEmail.Textbody = "Test Mail"
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTP SERVER NAME"
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = "1"
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendusername") =
"[email protected]"
objEmail.Configuration.Fields.Item
("http://schemas.microsoft.com/cdo/configuration/sendpassword") =
"Email_Account_Password"
objEmail.Configuration.Fields.Update
objEmail.Send
If Not err.number=0 Then
Response.write "ERROR: " & err.Description
err.Clear
Else
Response.write "Email sent to " & objEmail.To
end if
%>
Gmail: Set up POP
Incoming Mail (POP) Server: pop.gmail.com
Requires SSL: Yes
Port: 995
Outgoing Mail (SMTP) Server: smtp.gmail.com
Requires SSL: Yes
Requires TLS: Yes (if available)
Requires Authentication: Yes
Port for TLS/STARTTLS: 587
Server timeouts Greater than 1 minute (5 is recommended)
Full Name or Display Name: Your name
Account Name, User Name, or Email address: Your email address
Password: Your Gmail password
Gmail: Set up IMAP
Incoming Mail (IMAP) Server: imap.gmail.com
Requires SSL: Yes
Port: 993
Outgoing Mail (SMTP) Server: smtp.gmail.com
Requires SSL: Yes
Requires TLS: Yes (if available)
Requires Authentication: Yes
Port for SSL: 465
Port for TLS/STARTTLS: 587
Full Name or Display Name: Your name
Account Name, User name, or Email address: Your full email address
Password: Your Gmail password