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. General Programming
  3. C#
  4. Send Mail in C# 2005

Send Mail in C# 2005

Scheduled Pinned Locked Moved C#
csharpquestion
5 Posts 3 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.
  • A Offline
    A Offline
    ahchoo
    wrote on last edited by
    #1

    HI, I got trouble of sending an email out from my application. An exception happened when from smtpclient.send object . Any suggestion? Thanks. Kyah

    L 1 Reply Last reply
    0
    • A ahchoo

      HI, I got trouble of sending an email out from my application. An exception happened when from smtpclient.send object . Any suggestion? Thanks. Kyah

      L Offline
      L Offline
      Luis Alonso Ramos
      wrote on last edited by
      #2

      Could you give us some information on the exception? what type? what was the error message? Also, could you post some your code (the 10 o 15 lines where you send the email)? From what you say it's hard for us to know the problem.

      Luis Alonso Ramos Intelectix Chihuahua, Mexico

      Not much here: My CP Blog!

      A 1 Reply Last reply
      0
      • L Luis Alonso Ramos

        Could you give us some information on the exception? what type? what was the error message? Also, could you post some your code (the 10 o 15 lines where you send the email)? From what you say it's hard for us to know the problem.

        Luis Alonso Ramos Intelectix Chihuahua, Mexico

        Not much here: My CP Blog!

        A Offline
        A Offline
        ahchoo
        wrote on last edited by
        #3

        I just followed the sample code in the MSDN library for Visual Studio in 2005. The exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: U able to connect to the remote server ---> System.Net.Sockets.SocketException: An est blished connection was aborted by the software in your host machine at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress s cketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s , Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncRes lt 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 imeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 tim out, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asy cCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDeleg te 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) ----------------- I just want to send a test to my network mail server not local machine. Thanks. Kyah

        L S 2 Replies Last reply
        0
        • A ahchoo

          I just followed the sample code in the MSDN library for Visual Studio in 2005. The exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: U able to connect to the remote server ---> System.Net.Sockets.SocketException: An est blished connection was aborted by the software in your host machine at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress s cketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s , Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncRes lt 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 imeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 tim out, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asy cCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDeleg te 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) ----------------- I just want to send a test to my network mail server not local machine. Thanks. Kyah

          L Offline
          L Offline
          Luis Alonso Ramos
          wrote on last edited by
          #4

          I haven't seen the code, but I would guess you are trying to use localhost as your SMTP server when the service has not been enabled. Could you post the code?

          Luis Alonso Ramos Intelectix Chihuahua, Mexico

          Not much here: My CP Blog!

          1 Reply Last reply
          0
          • A ahchoo

            I just followed the sample code in the MSDN library for Visual Studio in 2005. The exception: System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: U able to connect to the remote server ---> System.Net.Sockets.SocketException: An est blished connection was aborted by the software in your host machine at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress s cketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s , Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncRes lt 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 imeout) at System.Net.PooledStream.Activate(Object owningObject, Boolean async, Int32 tim out, GeneralAsyncDelegate asyncCallback) at System.Net.PooledStream.Activate(Object owningObject, GeneralAsyncDelegate asy cCallback) at System.Net.ConnectionPool.GetConnection(Object owningObject, GeneralAsyncDeleg te 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) ----------------- I just want to send a test to my network mail server not local machine. Thanks. Kyah

            S Offline
            S Offline
            Susan Hernandez
            wrote on last edited by
            #5

            I have run into this problem. In my case, our Virus software was preventing the mail from being sent. Our administrator had to allow mail coming from my machine for the vshost.exe process.

            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