Email Script
Email Script
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]
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#
' VB.NET
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
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>
<%
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
%>
Port: 995
Port: 993