Cannot send emails with ASP.NET

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("noreply@mydomain.com", "Welcome to My Domain")
                msg.IsBodyHtml = True
                msg.From = addrFrom
                msg.To.Add(F1.Text)
                msg.Subject = "Test"
                msg.Body = "Test"
                smtp.Host = "127.0.0.1"
                smtp.Port = 25
                smtp.DeliveryMethod = Net.Mail.SmtpDeliveryMethod.Network
                smtp.Credentials = New System.Net.NetworkCredential("Administrator", "xxxxxxxxxxx")
                smtp.Send(msg)
            End If

Open in new window

pvg1975Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Marcin_ZawadzkiCommented:
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).
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.