SMTP Authentication with config file's MailSettings

SMTP Authentication with config file's MailSettings

I'm storing my MailSettings in a web.config, however when I send the message, my SMTP server reports back that I need to use authentication. I've got my username/password in the config file, but it still fails.

It works if I do the following, but it seems like an extra step. Shouldn't it just take it from the config file and use authentication automatically?

System.Configuration.Configuration config = WebConfigurationManager.OpenWebConfiguration(
MailSettingsSectionGroup settings =
    (MailSettingsSectionGroup) config.GetSectionGroup("");

SmtpClient client = new SmtpClient();
client.Credentials = new NetworkCredential(
   settings.Smtp.Network.UserName, settings.Smtp.Network.Password);


        <smtp from="" deliveryMethod="Network">
            <network host="" defaultCredentials="true"
                userName="me@xyzcom" password="abc123" />


Exceeded storage allocation. The server response was: Please use smtp authentication.

The "Exceeded storage allocation" confused us for quite awhile, we now ignore it. It's the "use smtp authentication" that seems to be important.