Enviar correo desde VB 2015 RRS feed

  • Debate general

  • Buen dia, no he podido enviar correso desde visual, aparese el siguiente error

    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.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, 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)
       at System.Net.PooledStream.Activate(Object owningObject, Boolean async, 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(ServicePoint servicePoint)
       at System.Net.Mail.SmtpTransport.GetConnection(ServicePoint servicePoint)
       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 mail.Form1.Button1_Click(Object sender, EventArgs e) in c:\users\jjimene1\documents\visual studio 2015\Projects\mail\mail\Form1.vb:line 22

    El fuente.

                correo.Body = ""
                correo.Subject = ""
                correo.Body = "msjj"
                correo.IsBodyHtml = True

                correo.From = New MailAddress("")
                enviar.Credentials = New Net.NetworkCredential("", "password")

                enviar.Host = ""  ' ""
                enviar.Port = 587
                enviar.EnableSsl = True


            Catch ex As Exception
            End Try

    jueves, 8 de septiembre de 2016 15:07

Todas las respuestas