[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

email error

Posted on 2008-02-01
1
Medium Priority
?
417 Views
Last Modified: 2012-05-05
   
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" %>
0
Comment
Question by:gianitoo
1 Comment
 
LVL 9

Accepted Solution

by:
zkeown earned 2000 total points
ID: 20799966
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

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this Article, I will provide a few tips in problem and solution manner. Opening an ASPX page in Visual studio 2003 is very slow. To make it fast, please do follow below steps:   Open the Solution/Project. Right click the ASPX file to b…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
In this video I will demonstrate how to set up Nine, which I now consider the best alternative email app to Touchdown.
Suggested Courses

591 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