Thanks for this :)
bigz_1000
Posts
-
Email Sender :the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond -
Email Sender :the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondyes ... Thanks
-
Email Sender :the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondI set EnableSsl = true but I have same exception
-
Email Sender :the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respondHi there, I have another problem in my code, this is my code :
private void SendEmail(MailMessage message, MailAddress from)
{SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587); smtpClient.EnableSsl = false; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = new NetworkCredential("someone@gmail.com", "password"); try { smtpClient.Send(message); } catch (Exception ex) { throw new Exception(ex.Message); } finally { message.Dispose(); } }
and now I have following exception in line "smtpClient.Send(message)" : 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 209.85.143.108:587 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, 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(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 EmailSender.EmailSenderForm.SendEmail(MailMessage message, MailAddress from) in is i
-
EmailSender : A socket operation was attempted to an unreachable networkHi there! I have an exception in my senderemail program. here the code:
private void SendEmail(MailMessage message, MailAddress from)
{
message.Subject = txtTitle.Text;
message.SubjectEncoding = Encoding.UTF8;
message.BodyEncoding = Encoding.UTF8;
SmtpClient smtpClient = new SmtpClient(Properties.Settings.Default.SMTPServer);
smtpClient.EnableSsl = false;
smtpClient.UseDefaultCredentials = false;
smtpClient.Credentials = new NetworkCredential();
try
{
smtpClient.Send(message);} catch (Exception ex) { throw new Exception(ex.Message); } finally { message.Dispose(); } }
but in line "smtpClient.Send(message);" I have the following exception : System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: A socket operation was attempted to an unreachable network 74.112.253.35:25 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, 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(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 EmailSender.EmailSenderForm.SendEmail(MailMessage message, MailAddress from) i
-
email sender program : Unable to connect to the remote serverI think , that is the reason.thanks ! :)
-
email sender program : Unable to connect to the remote serverDon't work, same exception! but thanks anyway
-
email sender program : Unable to connect to the remote serverHi there, I write a program trying to send email via my gmail account, here is the code:
MailMessage message = new MailMessage();
MailAddress sender = new MailAddress("username@gmail.com");message.Body = "just for test"; message.From = sender; foreach (String strEmail in emailList) { MailAddress reciever = new MailAddress(strEmail); message.Bcc.Add(reciever); } message.Subject = "test"; message.SubjectEncoding = Encoding.UTF8; message.BodyEncoding = Encoding.UTF8; SmtpClient smtpClient = new SmtpClient("smtp.gmail.com", 587); smtpClient.EnableSsl = true; smtpClient.UseDefaultCredentials = false; smtpClient.Credentials = new NetworkCredential("username@gmail.com","password"); // smtpClient.DeliveryMethod = SmtpDeliveryMethod.Network; try { smtpClient.Send(message); } catch (Exception ex) { MessageBox.Show(ex.ToString()); throw new Exception(ex.Message); } finally { message.Dispose(); }
but I have an exception in the line :"smtpClient.Send(message);" , here is it:
System.Net.Mail.SmtpException: Failure sending mail. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 74.125.43.108:587
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, 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 a