[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

new in asp.net

Posted on 2004-10-25
10
Medium Priority
?
970 Views
Last Modified: 2013-11-25
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
Comment
Question by:gianitoo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
10 Comments
 
LVL 1

Author Comment

by:gianitoo
ID: 12403362
here is the page...so u can see the rror

http://www.indianayouthsoccer.org/samples/simple/simple.aspx
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403371
What's the error?
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403384
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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 14

Expert Comment

by:dfu23
ID: 12403386
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
 
LVL 1

Author Comment

by:gianitoo
ID: 12403452
i dont have  a webconfig file for that page.   i can include it though....do you include it as a server side include?
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403506
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
 
LVL 14

Accepted Solution

by:
dfu23 earned 2000 total points
ID: 12403631
Do you have the assembly (DLL) for ASPEMAILLib? It needs to go into the bin directory on your website ...
0
 
LVL 1

Author Comment

by:gianitoo
ID: 12403780
got it..thanks
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403792
did that solve the problem or are there still issues?
0
 
LVL 14

Expert Comment

by:dfu23
ID: 12403795
cool
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

656 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