Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. SMTP Exception

SMTP Exception

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netvisual-studiosysadmin
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    DKalepu
    wrote on last edited by
    #1

    Hi All, I keep getting an exception whenever i try to send an email message in an asp.net 2.0 application: I am using smtpclient & I have the MailMessage code and credentials setup correctly. **************************************************************************** Send failure: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Default2.btnSubmit_Click(Object sender, EventArgs e) in c:\Documents and Settings\venki\My Documents\Visual Studio 2005\WebSites\RFQTest\Default2.aspx.cs:line 88Your mail has been sent ***************************************************************************** Could anyone help me is it any problem with my internet connection? or Do i need to change my code?? Thanks in Advance! :confused: :confused::confused:

    S D 2 Replies Last reply
    0
    • D DKalepu

      Hi All, I keep getting an exception whenever i try to send an email message in an asp.net 2.0 application: I am using smtpclient & I have the MailMessage code and credentials setup correctly. **************************************************************************** Send failure: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Default2.btnSubmit_Click(Object sender, EventArgs e) in c:\Documents and Settings\venki\My Documents\Visual Studio 2005\WebSites\RFQTest\Default2.aspx.cs:line 88Your mail has been sent ***************************************************************************** Could anyone help me is it any problem with my internet connection? or Do i need to change my code?? Thanks in Advance! :confused: :confused::confused:

      S Offline
      S Offline
      Steven J Jowett
      wrote on last edited by
      #2

      Post the code you have written, that sends the email.

      Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'

      D 1 Reply Last reply
      0
      • S Steven J Jowett

        Post the code you have written, that sends the email.

        Steve Jowett ------------------------- Sometimes a man who deserves to be looked down upon because he is a fool, is only despised only because he is an 'I.T. Consultant'

        D Offline
        D Offline
        DKalepu
        wrote on last edited by
        #3

        Here is my Code::: protected void btnSubmit_Click(object sender, EventArgs e) { SmtpClient smtpClient = new SmtpClient(); MailMessage objMail = new MailMessage(); MailAddress objMail_Email = new MailAddress(lblEmail1.Text); objMail.From = objMail_Email; objMail.To.Add("toemail@.. .com"); objMail.Subject = "Form Submission"; objMail.Body = "" + "

        Company : " + lblCompany1.Text + "

        " + "

        Address : " + lblAddress1.Text + "

        " + "

        Telephone :" + lblTelephone1.Text + "

        " + "

        Fax :" + lblFax1.Text + "

        " + "

        Email : " + lblEmail1.Text + "

        " + "

        Comments : " + lblComments1.Text + "

        " + ""; objMail.Priority = MailPriority.High; smtpClient.Host = "mail.domain.com"; smtpClient.Credentials = new System.Net.NetworkCredential("username@domain.com", "password"); try { smtpClient.EnableSsl = false; smtpClient.Send(objMail); } catch (Exception exc) { Response.Write("Send failure: " + exc.ToString()); } Response.Write("Your mail has been sent"); } _____________

        1 Reply Last reply
        0
        • D DKalepu

          Hi All, I keep getting an exception whenever i try to send an email message in an asp.net 2.0 application: I am using smtpclient & I have the MailMessage code and credentials setup correctly. **************************************************************************** Send failure: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception) --- End of inner exception stack trace --- at System.Net.ServicePoint.GetConnection(PooledStream PooledStream, Object owner, Boolean async, IPAddress& address, Socket& abortSocket, Socket& abortSocket6, Int32 timeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 timeout, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asyncCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDelegate asyncCallback, Int32 creationTimeout) at System.Net.Mail.SmtpConnection.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpTransport.GetConnection(String host, Int32 port) at System.Net.Mail.SmtpClient.GetConnection() at System.Net.Mail.SmtpClient.Send(MailMessage message) --- End of inner exception stack trace --- at System.Net.Mail.SmtpClient.Send(MailMessage message) at Default2.btnSubmit_Click(Object sender, EventArgs e) in c:\Documents and Settings\venki\My Documents\Visual Studio 2005\WebSites\RFQTest\Default2.aspx.cs:line 88Your mail has been sent ***************************************************************************** Could anyone help me is it any problem with my internet connection? or Do i need to change my code?? Thanks in Advance! :confused: :confused::confused:

          D Offline
          D Offline
          DKalepu
          wrote on last edited by
          #4

          anyone please help me on my problem............. :((:((:((

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups