Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6235881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:44:55+00:00 2026-05-24T10:44:55+00:00

The context: We’re a small company that does not have an Exchange Server (or

  • 0

The context:

We’re a small company that does not have an Exchange Server (or anyone dedicated to it) yet we still need to have/send emails.

We’ve decided to use Microsoft Online Services (MOS)


The Objective:

We have a web server (Windows Server 2003 R2 with IIS 6.0) and have deployed a C# ASP.Net MCV application.

The web application needs to send emails each time a user creates an account.

According to the documentation we need to use port (587) and make sure Transport Layer Security (TLS) enable. In addition, the FROM address being used must be of type “Authoritative” which it is when I double check via the Microsoft Online Administration Center


The code:

The C# code I have should be trivial and is the following:

SmtpClient server = new SmtpClient("Smtp.mail.microsoftonline.com");
server.Port = 587;
server.EnableSsl = true;
server.Credentials = new System.Net.NetworkCredential("xxx@domain.com", "123abc");
server.UseDefaultCredentials = false;

MailMessage mail = new MailMessage();
mail.From = new MailAddress("xxx@domain.com");
mail.To.Add("johndoe@domain.com");
mail.Subject = "test subject";
mail.Body = "this is my message body";
mail.IsBodyHtml = true;

try
{
    server.Send(mail);
}
catch (Exception ex)
{
    throw ex;
}

The error:

I’ve created a simple winform application with the above code to test the sending of emails…
I’ve tested the winform application locally on my computer (Windows XP) and on the Server.

In both attempt, I keep receiving the following error message:

The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.1 Client was not authenticated.

After Googling for a while I still haven’t found the reason why…In addition, most of the answers I’ve found are making a reference to the Exchange Management Console which we don’t seem to have (or installed) hence why we are using Microsoft Online Services…


Questions:

1) As a paying customer of MOS, my initial understanding is that I shouldn’t have to install (or have) an Exchange Management Console on our server…in fact, this should be completely irrelevant in order to achieve my task.

2) I’ve also tried enabling TLS inside our IIS 6.0 but to no avail…

3) We are grasping at straws here because what we seem to do looks like something amazingly trivial…

4) Should we simply abandon the idea of using MOS’s SMTP server and use another one? Such as Gmail’s ? If so…then why bother paying a monthly fee for MOS?

If any one has any help/advice that can help me shed some light on this, that would be great!

Sincerely
Vince



WOW…I believe we’ve found the culprit!!!

By commenting this line of code:

//server.UseDefaultCredentials = false;

Everything started to work!

I’m now able to send emails inside and outside our domain…

What puzzles me the most is that, according to the documentation, the default value of this UseDefaultCredentials property is set to false

So…when I manually set it to false it doesn’t work but when I comment the line (which also set’s it to false because of its default value) it works!

If this is a known issue or if anyone has an answer for that, I’d be curious to know!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T10:44:57+00:00Added an answer on May 24, 2026 at 10:44 am

    looking in Reflector on UseDefaultCredentials property, you can see that it also changes the trasnport.Credentials value, so when you called this property with a false value, it changed the transport credentials to null.
    the problem is that you called this property after setting the credentials in the line before that,
    it nullified the credentials.

    so bottom line, you shouldn’t set the credentials and call this property afterwise.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Context: I work at a small software company that has traditionally done research-type work,
Context: I have a WPF App that uses certain unmanaged DLLs in the D:\WordAutomation\MyApp_Source\Executables\MyApp
Context I have a very large number of small classes or structures . The
I have a small installer that installs some .exe and DLLs to the target
I have small question regarding the following error: this.context.sourceCache On a custom control I
I am writing a small utility to send JMS messages to a remote server,
I need to write a shell extension for a small context menu. unfortunately i
i have a small maven project with <artifactId>spring-core</artifactId> <artifactId>spring-test</artifactId> <artifactId>spring-beans</artifactId> <artifactId>spring-context</artifactId> <artifactId>spring-aop</artifactId> <artifactId>spring-context-support</artifactId> <artifactId>spring-tx</artifactId>
I have seen this code in web.xml file <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> I build small
I have created a small test app. It creates a new company and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.