Help! SMTP Exception Error in ASP 2.0 Email Form

Discussion in 'ASP .Net Web Controls' started by Bgreer5050, Sep 11, 2007.

  1. Bgreer5050

    Bgreer5050 Guest

    I keep getting the following error on an asp form I have on my site. I know
    the smtp settings are correct, because if I take out the user fields (i.e.
    name, weight and assign a text string in code the email is processed.

    Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    System.EventArgs) Handles SendEmail.Click
    Const ToAddress As String =
    Dim mm As New Net.Mail.MailMessage(, ToAddress)
    mm.Subject = "Parts Request"
    mm.Body = "Body" -----------------If I use mm.body = name.text I get the
    timeout error
    mm.Body = "weight"
    mm.IsBodyHtml = False
    Dim smtp As New Net.Mail.SmtpClient
    smtp.Send(mm)
    End Sub


    Is it possible that it takes longer to process text boxes, therefore some
    code needs to be added to prevent the timeout? If so, can someone help me
    with the code snippet?


    Here is the Error:

    Service not available, closing transmission channel. The server response
    was: Command timeout, closing transmission channel
    Description: An unhandled exception occurred during the execution of the
    current web request. Please review the stack trace for more information
    about the error and where it originated in the code.

    Exception Details: System.Net.Mail.SmtpException: Service not available,
    closing transmission channel. The server response was: Command timeout,
    closing transmission channel

    Source Error:

    Line 20:
    Line 21: '(4) Send the MailMessage (will use the Web.config
    settings)
    Line 22: smtp.Send(mm)
    Line 23: End Sub
    Line 24:
    Bgreer5050, Sep 11, 2007
    #1
    1. Advertising

  2. On Sep 11, 10:46 pm, "Bgreer5050" <> wrote:
    > I keep getting the following error on an asp form I have on my site. I know
    > the smtp settings are correct, because if I take out the user fields (i.e.
    > name, weight and assign a text string in code the email is processed.
    >
    > Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles SendEmail.Click
    > Const ToAddress As String =
    > Dim mm As New Net.Mail.MailMessage(, ToAddress)
    > mm.Subject = "Parts Request"
    > mm.Body = "Body" -----------------If I use mm.body = name.text I get the
    > timeout error
    > mm.Body = "weight"
    > mm.IsBodyHtml = False
    > Dim smtp As New Net.Mail.SmtpClient
    > smtp.Send(mm)
    > End Sub
    >
    > Is it possible that it takes longer to process text boxes, therefore some
    > code needs to be added to prevent the timeout? If so, can someone help me
    > with the code snippet?
    >
    > Here is the Error:
    >
    > Service not available, closing transmission channel. The server response
    > was: Command timeout, closing transmission channel
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.Net.Mail.SmtpException: Service not available,
    > closing transmission channel. The server response was: Command timeout,
    > closing transmission channel
    >
    > Source Error:
    >
    > Line 20:
    > Line 21: '(4) Send the MailMessage (will use the Web.config
    > settings)
    > Line 22: smtp.Send(mm)
    > Line 23: End Sub
    > Line 24:


    Try to check the event log to see if there are any hints on that
    Alexey Smirnov, Sep 11, 2007
    #2
    1. Advertising

  3. Bgreer5050

    Bgreer5050 Guest

    Ok. This is a silly question....where is the event log? My site is hosted
    offsite on a IIS server. Is it the same thing as the Stack Trace?

    Thanks

    "Alexey Smirnov" <> wrote in message
    news:...
    > On Sep 11, 10:46 pm, "Bgreer5050" <> wrote:
    >> I keep getting the following error on an asp form I have on my site. I
    >> know
    >> the smtp settings are correct, because if I take out the user fields
    >> (i.e.
    >> name, weight and assign a text string in code the email is processed.
    >>
    >> Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    >> System.EventArgs) Handles SendEmail.Click
    >> Const ToAddress As String =
    >> Dim mm As New Net.Mail.MailMessage(, ToAddress)
    >> mm.Subject = "Parts Request"
    >> mm.Body = "Body" -----------------If I use mm.body = name.text I get the
    >> timeout error
    >> mm.Body = "weight"
    >> mm.IsBodyHtml = False
    >> Dim smtp As New Net.Mail.SmtpClient
    >> smtp.Send(mm)
    >> End Sub
    >>
    >> Is it possible that it takes longer to process text boxes, therefore some
    >> code needs to be added to prevent the timeout? If so, can someone help
    >> me
    >> with the code snippet?
    >>
    >> Here is the Error:
    >>
    >> Service not available, closing transmission channel. The server response
    >> was: Command timeout, closing transmission channel
    >> Description: An unhandled exception occurred during the execution of the
    >> current web request. Please review the stack trace for more information
    >> about the error and where it originated in the code.
    >>
    >> Exception Details: System.Net.Mail.SmtpException: Service not available,
    >> closing transmission channel. The server response was: Command timeout,
    >> closing transmission channel
    >>
    >> Source Error:
    >>
    >> Line 20:
    >> Line 21: '(4) Send the MailMessage (will use the Web.config
    >> settings)
    >> Line 22: smtp.Send(mm)
    >> Line 23: End Sub
    >> Line 24:

    >
    > Try to check the event log to see if there are any hints on that
    >
    Bgreer5050, Sep 12, 2007
    #3
  4. Bgreer5050

    Braulio Diez Guest

    What do you store on name.text? It's a simple string?

    I would try the following:

    - Hardcode what you typed on the text box and set it as a hardcode
    string, did you get an error?

    - Pass what you typed on the textbox to an string variable, and assign it
    to the body, did you get the error?

    This tests are just to delimit where can be located the failure. It's
    quite strange.

    /// ------------------------------
    /// Braulio Diez
    ///
    /// http://www.tipsdotnet.com
    /// ------------------------------




    "Bgreer5050" wrote:

    > I keep getting the following error on an asp form I have on my site. I know
    > the smtp settings are correct, because if I take out the user fields (i.e.
    > name, weight and assign a text string in code the email is processed.
    >
    > Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    > System.EventArgs) Handles SendEmail.Click
    > Const ToAddress As String =
    > Dim mm As New Net.Mail.MailMessage(, ToAddress)
    > mm.Subject = "Parts Request"
    > mm.Body = "Body" -----------------If I use mm.body = name.text I get the
    > timeout error
    > mm.Body = "weight"
    > mm.IsBodyHtml = False
    > Dim smtp As New Net.Mail.SmtpClient
    > smtp.Send(mm)
    > End Sub
    >
    >
    > Is it possible that it takes longer to process text boxes, therefore some
    > code needs to be added to prevent the timeout? If so, can someone help me
    > with the code snippet?
    >
    >
    > Here is the Error:
    >
    > Service not available, closing transmission channel. The server response
    > was: Command timeout, closing transmission channel
    > Description: An unhandled exception occurred during the execution of the
    > current web request. Please review the stack trace for more information
    > about the error and where it originated in the code.
    >
    > Exception Details: System.Net.Mail.SmtpException: Service not available,
    > closing transmission channel. The server response was: Command timeout,
    > closing transmission channel
    >
    > Source Error:
    >
    > Line 20:
    > Line 21: '(4) Send the MailMessage (will use the Web.config
    > settings)
    > Line 22: smtp.Send(mm)
    > Line 23: End Sub
    > Line 24:
    >
    >
    >
    Braulio Diez, Sep 12, 2007
    #4
  5. On Sep 12, 2:28 am, "Bgreer5050" <> wrote:
    > Ok. This is a silly question....where is the event log? My site is hosted
    > offsite on a IIS server. Is it the same thing as the Stack Trace?
    >
    > Thanks
    >
    > "Alexey Smirnov" <> wrote in message
    >
    > news:...
    >
    >
    >
    > > On Sep 11, 10:46 pm, "Bgreer5050" <> wrote:
    > >> I keep getting the following error on an asp form I have on my site. I
    > >> know
    > >> the smtp settings are correct, because if I take out the user fields
    > >> (i.e.
    > >> name, weight and assign a text string in code the email is processed.

    >
    > >> Protected Sub SendEmail_Click(ByVal sender As Object, ByVal e As
    > >> System.EventArgs) Handles SendEmail.Click
    > >> Const ToAddress As String =
    > >> Dim mm As New Net.Mail.MailMessage(, ToAddress)
    > >> mm.Subject = "Parts Request"
    > >> mm.Body = "Body" -----------------If I use mm.body = name.text I get the
    > >> timeout error
    > >> mm.Body = "weight"
    > >> mm.IsBodyHtml = False
    > >> Dim smtp As New Net.Mail.SmtpClient
    > >> smtp.Send(mm)
    > >> End Sub

    >
    > >> Is it possible that it takes longer to process text boxes, therefore some
    > >> code needs to be added to prevent the timeout? If so, can someone help
    > >> me
    > >> with the code snippet?

    >
    > >> Here is the Error:

    >
    > >> Service not available, closing transmission channel. The server response
    > >> was: Command timeout, closing transmission channel
    > >> Description: An unhandled exception occurred during the execution of the
    > >> current web request. Please review the stack trace for more information
    > >> about the error and where it originated in the code.

    >
    > >> Exception Details: System.Net.Mail.SmtpException: Service not available,
    > >> closing transmission channel. The server response was: Command timeout,
    > >> closing transmission channel

    >
    > >> Source Error:

    >
    > >> Line 20:
    > >> Line 21: '(4) Send the MailMessage (will use the Web.config
    > >> settings)
    > >> Line 22: smtp.Send(mm)
    > >> Line 23: End Sub
    > >> Line 24:

    >
    > > Try to check the event log to see if there are any hints on that- Hide quoted text -

    >
    > - Show quoted text -


    Control Panel - Administrative Tools - Event Viewer
    Alexey Smirnov, Sep 12, 2007
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    3
    Views:
    1,053
    Roedy Green
    Jan 24, 2006
  2. Alex Hunsley
    Replies:
    4
    Views:
    3,417
    Tim Williams (gmail)
    Jun 29, 2004
  3. Bgreer5050
    Replies:
    4
    Views:
    1,232
    Alexey Smirnov
    Sep 12, 2007
  4. tamaker
    Replies:
    3
    Views:
    155
    Anthony Jones
    Dec 13, 2007
  5. ashish makani
    Replies:
    5
    Views:
    563
    Mark Lawrence
    Sep 20, 2012
Loading...

Share This Page