Why this code does not send email?

Posted on 2011-10-11
Last Modified: 2012-06-27
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
            'English News
            MyCommand.CommandType = CommandType.StoredProcedure
            MyCommand.Parameters.Add("@module", "UpdateRSS")
            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 = ""
            Dim strTo As String = ""
            While dr.Read
                strTo = strTo + ";" + dr("ae_email")

            End While
            mm.To = strTo

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

Open in new window

and here is the webconfig:

					 port="25" />

Open in new window

Question by:Sindibad_123

    Author Comment

    Anyone! It's around 4 hours passed and still did not get any answer!
    LVL 96

    Assisted Solution

    by:Bob Learned
    Are there any exceptions?  Have you configured the SmtpClient correctly for

    Author Comment

    I got this exception:
    "The "SendUsing" configuration value is invalid"
    LVL 26

    Accepted Solution

    check this one out
    the following site is the google of sending mails from

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
    ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
    This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor ( If you're looking for how to monitor bandwidth using netflow or packet s…

    745 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

    18 Experts available now in Live!

    Get 1:1 Help Now