email error

   
getting this errror
my code is also below

Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30561: 'Mail' is ambiguous, imported from the namespaces or types 'System.Web, System.Net'.

Source Error:

 

Line 39:             SqlDataSource1.Update()
Line 40:            
Line 41:             Dim objMailMessage As Mail.MailMessage
Line 42:             Dim strHTMLBody As String
Line 43:
 

Source File: D:\Inetpub\wwwroot\JMI\JMI\clients\crownroyal\storeconfirmation.aspx    Line: 41


 strHTMLBody = "<html><head>" & _
         "<title>Thank You!</title>" & _
         "</head><body>" & _
            "<a href=http://crracingnetwork.com/admin>click here to access secure site</a>" & _
         "</font></body></html>"





            ' Create the Mail Message
            objMailMessage = New MailMessage

            objMailMessage.From = "jgazzola@justmarketing.com"
            objMailMessage.To = "jgazzola@justmarketing.com"
            objMailMessage.Bcc = "gbarraza@justmarketing.com"
            objMailMessage.Subject = "New store order with Id: " + Session("payment")
            objMailMessage.Body = strHTMLBody
            objMailMessage.BodyFormat = MailFormat.Html
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1") 'basic authentication
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername", "smtp") 'set your username here
            objMailMessage.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", "smtpuser") 'set your password here


            ' Send the Mail Message

            SmtpMail.SmtpServer = "10.10.1.20"
            SmtpMail.Send(objMailMessage)


i am using these namespaces

<%@ Import Namespace="System.Net" %>

<%@ Import Namespace="System.Web.Mail" %>

<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Text" %>

<%@ Import Namespace="System.Data.SqlClient" %>


<%@ Import Namespace="System.IO" %>
LVL 1
gianitooAsked:
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.

zkeownCommented:
You shouldn't need the System.Web.Mail namespace; that was deprecated in .NET 2.0 in favor of the System.Net.Mail namespace.  Take out that Imports statement and see if it works then.
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.