Why this code does not send email?

Hi, can someone figure out what is wrong(s) with this code, it does not send email?(Im using .NET 2 framework)

Protected Sub SendEmail(ByVal strError As String, ByVal file As String)

        Dim MyConnection As New SqlConnection(Configuration.ConfigurationSettings.AppSettings("ConnStr"))
        Dim MyCommand As New SqlCommand("GetAutoEmails", MyConnection)
        Dim dr As SqlDataReader
        Try
            'English News
            '---------------------------------------------------------------------'
            MyCommand.CommandType = CommandType.StoredProcedure
            MyCommand.Parameters.Add("@module", "UpdateRSS")
            MyConnection.Open()
            dr = MyCommand.ExecuteReader(CommandBehavior.Default)

            '(1) Create the MailMessage instance
            Dim mm As New Mail.MailMessage()

            '(2) Assign the MailMessage's properties
            mm.Subject = "Xml feed error"
            mm.Body = "Please check RSS they are not updated, got errors in the following file:" + file + "<br>" + strError
            mm.From = "tech@menafn.com"
            Dim strTo As String = ""
            While dr.Read
                strTo = strTo + ";" + dr("ae_email")

            End While
            mm.To = strTo
            Mail.SmtpMail.Send(mm)

        Catch ex As Exception
            Response.Write("Error..." + ex.Message + "<br><br>")
        End Try
    End Sub

Open in new window



and here is the webconfig:

<system.net>
		<mailSettings>
			<smtp>
				<network
			                 host="dedrelay.secureservers.net"
					 port="25" />
			</smtp>
		</mailSettings>
	</system.net>

Open in new window

Sindibad_123Asked:
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.

Sindibad_123Author Commented:
Anyone! It's around 4 hours passed and still did not get any answer!
0
Bob LearnedCommented:
Are there any exceptions?  Have you configured the SmtpClient correctly for dedrelay.secureservers.net?
0
Sindibad_123Author Commented:
I got this exception:
"The "SendUsing" configuration value is invalid"
0
Anurag ThakurTechnical ManagerCommented:
check this one out
the following site is the google of sending mails from asp.net
http://www.systemwebmail.com/faq/4.2.2.aspx
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
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.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.