Link to home
Start Free TrialLog in
Avatar of gianitoo
gianitoo

asked on

new in asp.net

i created a page in asp.net called index.aspx   and it works fine.    i would like to add a contact form written in the syntax below but it generates an error on the server.  do i have to enable anything for C language to work?


<!-- AspEmail .NET Code samples: Simple.aspx -->
<!-- Copyright (c) 2002 Persits Software, Inc. -->
<!-- http://www.persits.com -->


<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="ASPEMAILLib" %>
<%@ Import Namespace="System.Reflection" %>


<script runat="server" LANGUAGE="C#">

void Page_Load(Object Source, EventArgs E)
{
      // Change this to your own SMTP server
      String strHost = "192.168.111.2";      
      
      txtHost.InnerHtml = strHost;      
      
      if( IsPostBack )
      {
            // MailSender object declaration
            ASPEMAILLib.IMailSender objMail;
            objMail = new ASPEMAILLib.MailSender();

            objMail.Host = strHost;

            objMail.From = txtFrom.Value;            // From address
            objMail.FromName = txtFromName.Value;      // optional

            // To address, 2nd argument optional
            objMail.AddAddress(txtTo.Value, Missing.Value);            
            
            // message subject
            objMail.Subject = txtSubject.Value;
            
            // message body
            objMail.Body = txtBody.Value;

            try
            {
                  objMail.Send(Missing.Value);
                  txtMsg.InnerHtml = "<font color=green>Success! Message sent to " + txtTo.Value + ".</font>";
            }
            catch(Exception e)
            {
                  txtMsg.InnerHtml = "<font color=red>Error occurred: " + e.Message + "</font>";
            }
      }
}

</script>
Avatar of gianitoo
gianitoo

ASKER

here is the page...so u can see the rror

http://www.indianayouthsoccer.org/samples/simple/simple.aspx
What's the error?
Server Error in '/' Application.
--------------------------------------------------------------------------------

Runtime Error
Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

Details: To enable the details of this specific error message to be viewable on remote machines, please create a <customErrors> tag within a "web.config" configuration file located in the root directory of the current web application. This <customErrors> tag should then have its "mode" attribute set to "Off".

Ok, in order for outsiders like me to be able to see the error you must set:

<customErrors mode="Off"/>

in the web.config file
i dont have  a webconfig file for that page.   i can include it though....do you include it as a server side include?
ok i got it...this is the output  error

Server Error in '/' Application.
--------------------------------------------------------------------------------

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: CS0246: The type or namespace name 'ASPEMAILLib' could not be found (are you missing a using directive or an assembly reference?)

Source Error:

 

Line 5:  
Line 6:  <%@ Import Namespace="System.Web" %>
Line 7:  <%@ Import Namespace="ASPEMAILLib" %>
Line 8:  <%@ Import Namespace="System.Reflection" %>
Line 9:  
 

Source File: D:\Websites\IYSA\samples\simple\simple.aspx    Line: 7



Show Detailed Compiler Output:


C:\WINNT\system32> "c:\winnt\microsoft.net\framework\v1.1.4322\csc.exe" /t:library /utf8output /R:"c:\winnt\assembly\gac\system.drawing\1.0.5000.0__b03f5f7f11d50a3a\system.drawing.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\f8c46580\32767da3_f0b6c401\absolutelivesupport.dll" /R:"c:\winnt\assembly\gac\system.web.mobile\1.0.5000.0__b03f5f7f11d50a3a\system.web.mobile.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\70b278db\2a5902dd_57b1c401\absolutenewsletter.dll" /R:"c:\winnt\assembly\gac\system.data\1.0.5000.0__b77a5c561934e089\system.data.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\0faef40b\b09c08eb_aab7c401\absolutenewsmanager.dll" /R:"c:\winnt\assembly\gac\system.enterpriseservices\1.0.5000.0__b03f5f7f11d50a3a\system.enterpriseservices.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\mscorlib.dll" /R:"c:\winnt\assembly\gac\system.web\1.0.5000.0__b03f5f7f11d50a3a\system.web.dll" /R:"c:\winnt\assembly\gac\system\1.0.5000.0__b77a5c561934e089\system.dll" /R:"c:\winnt\assembly\gac\system.web.services\1.0.5000.0__b03f5f7f11d50a3a\system.web.services.dll" /R:"c:\winnt\assembly\gac\system.xml\1.0.5000.0__b77a5c561934e089\system.xml.dll" /R:"c:\winnt\microsoft.net\framework\v1.1.4322\temporary asp.net files\root\9e3ee1a2\297b591d\assembly\dl2\b5d3c9c3\66fe5697_7289c301\dreamweaverctrls.dll" /out:"C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\9e3ee1a2\297b591d\fdkrswpo.dll" /debug- /optimize+ /warnaserror /w:1  "C:\WINNT\Microsoft.NET\Framework\v1.1.4322\Temporary ASP.NET Files\root\9e3ee1a2\297b591d\fdkrswpo.0.cs"


Microsoft (R) Visual C# .NET Compiler version 7.10.3052.4
for Microsoft (R) .NET Framework version 1.1.4322
Copyright (C) Microsoft Corporation 2001-2002. All rights reserved.

D:\Websites\IYSA\samples\simple\simple.aspx(7,11): error CS0246: The type or namespace name 'ASPEMAILLib' could not be found (are you missing a using directive or an assembly reference?)

 



Show Complete Compilation Source:
ASKER CERTIFIED SOLUTION
Avatar of dfu23
dfu23

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
got it..thanks
did that solve the problem or are there still issues?
cool