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
B

bigz_1000

@bigz_1000
About
Posts
8
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 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
    B bigz_1000

    Thanks for this :)

    C# csharp com sysadmin data-structures debugging

  • 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
    B bigz_1000

    yes ... Thanks

    C# csharp com sysadmin data-structures debugging

  • 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
    B bigz_1000

    I set EnableSsl = true but I have same exception

    C# csharp com sysadmin data-structures debugging

  • 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
    B bigz_1000

    Hi 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

    C# csharp com sysadmin data-structures debugging

  • EmailSender : A socket operation was attempted to an unreachable network
    B bigz_1000

    Hi 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

    C# sysadmin csharp data-structures debugging

  • email sender program : Unable to connect to the remote server
    B bigz_1000

    I think , that is the reason.thanks ! :)

    C# sysadmin csharp com data-structures debugging

  • email sender program : Unable to connect to the remote server
    B bigz_1000

    Don't work, same exception! but thanks anyway

    C# sysadmin csharp com data-structures debugging

  • email sender program : Unable to connect to the remote server
    B bigz_1000

    Hi 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

    C# sysadmin csharp com data-structures debugging
  • Login

  • Don't have an account? Register

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