• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 976
  • Last Modified:

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>
0
gianitoo
Asked:
gianitoo
  • 5
  • 5
1 Solution
 
gianitooAuthor Commented:
here is the page...so u can see the rror

http://www.indianayouthsoccer.org/samples/simple/simple.aspx
0
 
dfu23Commented:
What's the error?
0
 
gianitooAuthor Commented:
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".

0
Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

 
dfu23Commented:
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
0
 
gianitooAuthor Commented:
i dont have  a webconfig file for that page.   i can include it though....do you include it as a server side include?
0
 
gianitooAuthor Commented:
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:
0
 
dfu23Commented:
Do you have the assembly (DLL) for ASPEMAILLib? It needs to go into the bin directory on your website ...
0
 
gianitooAuthor Commented:
got it..thanks
0
 
dfu23Commented:
did that solve the problem or are there still issues?
0
 
dfu23Commented:
cool
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Windows 7 Basic

This introductory course to Windows 7 environment will teach you about working with the Windows operating system. You will learn about basic functions including start menu; the desktop; managing files, folders, and libraries.

  • 5
  • 5
Tackle projects and never again get stuck behind a technical roadblock.
Join Now