Send email confirmation in VB.NET

I have a web site done in ASP.NET with VB.NET.  I need to send an email confirmation of an online order after the customer checks out.  I have some code (see snippet) but MS Visual Web Developer doesn't like the MailMessage and several other parts, saying they're obsolete.  Will someone please tell me what the current (looking for .NET 3.5, but 2.0 may do) code for that?  I call the Sub on page-load.
Public Shared Sub SendMailMessage(ByVal from As String, ByVal recepient As String, ByVal bcc As String, ByVal cc As String, ByVal subject As String, ByVal body As String)
Dim mMailMessage As New MailMessage()
mMailMessage.From = New MailAddress(from)
mMailMessage.To.Add(New MailAddress(recepient))
        If Not bcc Is Nothing And bcc <> String.Empty Then
            mMailMessage.Bcc.Add(New MailAddress(bcc))
        End If
        If Not cc Is Nothing And cc <> String.Empty Then
            mMailMessage.CC.Add(New MailAddress(cc))
        End If
mMailMessage.Subject = subject
mMailMessage.Body = body
mMailMessage.IsBodyHtml = True
mMailMessage.Priority = MailPriority.Normal
Dim mSmtpClient As New SmtpClient()
End Sub

Open in new window

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.

You need to change your import from System.Web.Mail to System.Net.Mail.
The two objects you will most likely be interested are:

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
OVC-it-guyAuthor Commented:
Let me try that and fill in the parameters.
OVC-it-guyAuthor Commented:
Filled everything in, placed a test order and when the email routine was triggered I get an error "SMTP host was not specified," referring to the line,
OVC-it-guyAuthor Commented:
I seem to recall something about setting that in the web.config file.  Do you know, can you tell me what I am missing / should have?
OVC-it-guyAuthor Commented:
I remember it being something like this:

      <smtp deliveryMethod="Network" from="">
        <network defaultCredentials="true" host="localhost" port="25" userName="myusername" password="mypassword"/>
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
Visual Basic.NET

From novice to tech pro — start learning today.