Cannot send emails with ASP.NET

Posted on 2011-10-11
Last Modified: 2012-05-12
Hi all,

Im receiving the following message when I try to send an email (ASP.NET)

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

I configured SMTP already (IIS6) and selected INTEGRATED WINDOWS AUTHENTICATION.

But still not working.

Here's the code Im using:

Any ideas?
If System.Text.RegularExpressions.Regex.IsMatch(F1.Text, "^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$") = True Then
                Dim msg As New System.Net.Mail.MailMessage
                Dim smtp As New System.Net.Mail.SmtpClient
                Dim addrFrom As New System.Net.Mail.MailAddress("", "Welcome to My Domain")
                msg.IsBodyHtml = True
                msg.From = addrFrom
                msg.Subject = "Test"
                msg.Body = "Test"
                smtp.Host = ""
                smtp.Port = 25
                smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
                smtp.Credentials = New System.Net.NetworkCredential("Administrator", "xxxxxxxxxxx")
            End If

Open in new window

Question by:pvg1975
    LVL 3

    Accepted Solution

    Maybe use domain\username rather than just administrator?
    If this is not on a domain, then use machinename\username and see if that works?
    LVL 3

    Assisted Solution

    The better way is to use smtp setting from web.config, than hardcoded one.
    And if ASP.NET application is working on this same machine as SMTP, than you can use PICKUP delivery method instead of NETWORK (site will put EML file in your pickup directory, and SMTP will handle this).

    Featured Post

    Are your corporate email signatures appalling?

    Is it scary how unprofessional your email signatures look? Do users create their own terrible designs and give themselves stupid job titles? You can make this a lot easier for yourself by choosing an email signature management solution from Exclaimer today.

    Join & Write a Comment

    If you don't have the right permissions set for your WordPress location in IIS, you won't be able to perform automatic updates. Here's how to fix the problem.
    Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
    This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
    This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now