Visual Studio .NET - ASP.NET WEB application deployment

Asked By Developer M
26-Feb-04 06:31 AM
Hello sir,

I am new to ASP.NET development. I have a doubt in deployment of a ASP.NET application on a web server. It is specified that this webserver supports ASP.NET.

I have developed an ASP.NET application using Visual studio. I have a form in which there is a button on clicking it a mail is sent to my mail id.The code is in VB.NET.

Now I build this application and copied all the files to our web server where the site had to be hosted.....But I am able to view all the HTML pages and this webform1.aspx page too...But when I click the button to send mail I get a error message."Server Error "/"  in Application".

Ths error states to change some codes in web.config file ..And I changed it but still the same error is displayed and my code behind is not executed.....

Please help me find the cause for this error or why the code is not getting executed. When I run the application from VS I am able to send mails.

Please help.......
Thanks,
DM.

What is the error?  What is the error?

26-Feb-04 08:01 AM
Need a bit more to go on

ASP.NET web hosting  ASP.NET web hosting

27-Feb-04 01:12 AM
Ok...Here it is....
************************************************************************
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".


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="Off"/>
    </system.web>
</configuration>
 

Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.


<!-- Web.Config Configuration File -->

<configuration>
    <system.web>
        <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    </system.web>
</configuration>
 
***********************************************************************


And I set the <customError= "Off" > and tested same error.....

Thanks,
DM.

Detailesd error ...  Detailesd error ...

27-Feb-04 05:04 AM
Here is the detailed error coming...

***********************************************************************
System.Exception: Error sending mail ---> System.Web.HttpException: Could not access 'CDO.Message' object. ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x8004020F): The server rejected one or more recipient addresses. The server response was: 550 5.7.1 Unable to relay for hr@infonetco.com --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args) at System.Web.Mail.LateBoundAccessHelper.CallMethod(Type type, Object obj, String methodName, Object[] args) at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) --- End of inner exception stack trace --- at System.Web.Mail.LateBoundAccessHelper.CallMethod(Object obj, String methodName, Object[] args) at System.Web.Mail.CdoSysHelper.Send(MailMessage message) at System.Web.Mail.SmtpMail.Send(MailMessage message) at WebApplication2.postresume.Page_Posted() in D:\Inetpub\wwwroot\WebApplication2\postresume.aspx.vb:line 145 --- End of inner exception stack trace --- at WebApplication2.postresume.Page_Posted() in D:\Inetpub\wwwroot\WebApplication2\postresume.aspx.vb:line 147 at WebApplication2.postresume.Page_Load(Object sender, EventArgs e) in D:\Inetpub\wwwroot\WebApplication2\postresume.aspx.vb:line 45

*********************************************************************

This is my VB.NET code ::

**********************************************************************
 Dim message As String
        Dim lfilepath As String
        Dim mail As New MailMessage()
        'Dim mail
        'mail = Server.CreateObject("CDONTS.mail")
        Dim AttachmentPath As String

        Try
            AttachmentPath = UploadFile()
        Catch exp As Exception
            Response.Write("Error Uploading File. Please report this Error to the administrator")
            Response.End()
        End Try


        mail.BodyFormat = MailFormat.Html
        message = " Name= " & txtName.Text & "           " _
                           & "Contact Address = " & txtContactAddr.Text & "               " _
                           & "Qualification = " & txtQual.Text & "               "
        mail.From = "hr@infonetco.com"
       mail.To = "hr@infonetco.com"
        mail.Subject = "Resume From " & txtName.Text
        mail.Body = message
        mail.BodyFormat = MailFormat.Html
        'lfilepath = path.Text

        If AttachmentPath = "" Then
            Throw New Exception("No attachments...")
        Else
            mail.Attachments.Add(New MailAttachment(AttachmentPath, MailEncoding.Base64))
        End If

        Try
            'Set the SMTP server name
            SmtpMail.SmtpServer = "localhost"
            SmtpMail.Send(mail)
        Catch exp As Exception
            Throw New Exception("Error sending mail", exp)
        End Try
    End Sub


********************************************************************
It says it on the tin, with a bit of cleaning...  It says it on the tin, with a bit of cleaning...
27-Feb-04 05:45 AM
The server rejected one or more recipient addresses.  The server response was: 550 5.7.1 Unable to relay for hr@infonetco.com 

That's the problem. The code is "working" fine, the server component 'CDO.Message' is throwing an exception because it doesn't like its input.
????  ????
27-Feb-04 06:13 AM
So the mail ID is the problem??

If so I have tried with all types of mail IDS.....
Its more likely a config issue...  Its more likely a config issue...
27-Feb-04 08:53 AM
see http://www.systemwebmail.com/faq/4.3.11.aspx
Create New Account
help
Wise for Visual Studio.NET Wise for Visual Studio.NET By Peter A. Bromberg, Ph.D. To "Print This Page" Link Peter Bromberg Wise for Visual Studio .NET is a total and complete installation development system for creating and editing Windows® Installer
Visual Studio .net .NET Framework Hi NG, ich habe vor längerer Zeit mit Visual Studio .Net 2003 gearbeitet und überlege momentan auf einen neueren Stand upzudaten. Ein Visual Studio .Net 2008 scheint es nicht zu geben. Habe zumindest mit googeln nichts gefunden. Was
Visual Studio versioning . . . . how to tell? .NET Framework To my knowledge, Visual studio 6 was released in 1998, then Visual Studio .NET 2002 is VS 7, then Visual Studio .NET 2003 is VS 7.1, then Visual
visual studio.net 2003 and Access 2007 database .NET Framework Hi I am currently using Visual Studio.Net 2003 running on Windows Server 2000 operating system. I have used Visual Studio.net 2003 connecting to Access 2002 databases in the pass with great success. Now
Is Visual Studio self-hosting ? .NET Framework Does Microsoft use Visual Studio IDE, Visual Studio Debugger, Visual Studio Linker and Visual Studio compiler for developing Visual Studio ? Or is Visual Studio not