Link to home
Start Free TrialLog in
Avatar of gianitoo
gianitoo

asked on

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" %>
ASKER CERTIFIED SOLUTION
Avatar of zkeown
zkeown
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial