locked
(500)Internal Server Error RRS feed

  • Question

  • User-833081073 posted

    Hi,

    When i am sending  email on my local machine email working fine but when i am trying to send from Development server i am getting this error:

    laterSystem.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at NYCDOE.EIS.Portal.Utils.EMailUtil.MailWebPage(String url, SecureQueryString param, String emailfrom, String emailto, String emailsubject, String userid, String sysid) at EISPortal.PSWaivers.PSWaiverApplication.SendEmail_Click(Object sender, EventArgs e)

    Please help me to resolve this problem.

    Thanks.

    Thursday, March 21, 2019 2:40 PM

All replies

  • User475983607 posted

    Your Web Form is throwing an 500 internal server error.  There can be many reasons for this errors but without proper exception handling/logging it is difficult to determine.  Try checking the Event Viewer for errors.

    I recommend adding a try...catch to catch the exception message and stack trace.  

    Thursday, March 21, 2019 3:01 PM
  • User1520731567 posted

    Hi vaverbukh2,

    When i am sending  email on my local machine email working fine but when i am trying to send from Development server i am getting this error:

    laterSystem.Net.WebException: The remote server returned an error: (500) Internal Server Error. at System.Net.HttpWebRequest.GetResponse() at NYCDOE.EIS.Portal.Utils.EMailUtil.MailWebPage(String url, SecureQueryString param, String emailfrom, String emailto, String emailsubject, String userid, String sysid) at EISPortal.PSWaivers.PSWaiverApplication.SendEmail_Click(Object sender, EventArgs e)

    According to your descriptions,we couldn't directly find the issue.Because there are many reasons why this error can be caused.

    I suggest you could follow below ways to find the details error message.

    First, you need to enable and see detailed errors of your web messages, because this is a general message without giving information on what's really happening for security reasons.

    With the detailed error, you can locate the real issue here.

    Also, if you can run the browser on the server, you get details on the error, because the server recognizes that you are local and shows it to you. Or if you can read the log of the server using the Event Viewer, you also see the details of your error.

    <configuration>
    
    <system.webServer>
    <httpErrors errorMode="Detailed" />
    <asp scriptErrorSentToBrowser="true"/>
    </system.webServer>
    <system.web>
    <customErrors mode="Off"/>
    </system.web>
    </configuration>

    More details,you could refer to:

    https://stackoverflow.com/questions/5385714/deploying-website-500-internal-server-error

    Besides, I guess you may not use the right way to publish the app, you could refer to:

    https://docs.microsoft.com/en-us/aspnet/web-forms/overview/deployment/visual-studio-web-deployment/deploying-to-iis#publish-to-iis

    Best Regards.

    Yuki Tao

    Friday, March 22, 2019 2:42 AM