Click here to Skip to main content
16,005,037 members
Home / Discussions / C#
   

C#

 
GeneralRe: C#4.0 How Connect Crystal Report Pin
Ken H1234-Sep-11 20:45
Ken H1234-Sep-11 20:45 
GeneralRe: C#4.0 How Connect Crystal Report Pin
Ken H1234-Sep-11 20:48
Ken H1234-Sep-11 20:48 
QuestionLock DLL in C# Pin
jojoba20112-Sep-11 20:53
jojoba20112-Sep-11 20:53 
AnswerRe: Lock DLL in C# Pin
Abhinav S2-Sep-11 21:25
Abhinav S2-Sep-11 21:25 
AnswerRe: Lock DLL in C# Pin
harold aptroot3-Sep-11 1:32
harold aptroot3-Sep-11 1:32 
AnswerRe: Lock DLL in C# PinPopular
jschell3-Sep-11 10:43
jschell3-Sep-11 10:43 
GeneralRe: Lock DLL in C# Pin
Eddy Vluggen3-Sep-11 13:04
professionalEddy Vluggen3-Sep-11 13:04 
QuestionEmailSender : A socket operation was attempted to an unreachable network Pin
bigz_10002-Sep-11 19:53
bigz_10002-Sep-11 19:53 
Hi there!

I have an exception in my senderemail program.
here the code:

C#
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) in



how can I solve it?
AnswerRe: EmailSender : A socket operation was attempted to an unreachable network Pin
Mehdi Gholam2-Sep-11 20:03
Mehdi Gholam2-Sep-11 20:03 
Question[SOLVED] "Negative" Rectangle (ControlPaint.DrawReversibleFrame) To "Positive" Pin
Matt U.2-Sep-11 13:39
Matt U.2-Sep-11 13:39 
QuestionC# code for windows Pin
dcof2-Sep-11 6:45
dcof2-Sep-11 6:45 
AnswerRe: C# code for windows Pin
Abhinav S2-Sep-11 6:59
Abhinav S2-Sep-11 6:59 
QuestionRe: C# code for windows Pin
dcof2-Sep-11 18:13
dcof2-Sep-11 18:13 
AnswerMessage Removed Pin
2-Sep-11 7:05
professionalN_tro_P2-Sep-11 7:05 
GeneralRe: C# code for windows Pin
Luc Pattyn2-Sep-11 7:15
sitebuilderLuc Pattyn2-Sep-11 7:15 
GeneralRe: C# code for windows Pin
Abhinav S2-Sep-11 8:01
Abhinav S2-Sep-11 8:01 
QuestionRe: C# code for windows Pin
dcof2-Sep-11 8:34
dcof2-Sep-11 8:34 
AnswerRe: C# code for windows Pin
Abhinav S2-Sep-11 18:33
Abhinav S2-Sep-11 18:33 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:19
dcof2-Sep-11 8:19 
GeneralRe: C# code for windows Pin
Richard Andrew x642-Sep-11 8:46
professionalRichard Andrew x642-Sep-11 8:46 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:51
dcof2-Sep-11 8:51 
AnswerRe: C# code for windows Pin
OriginalGriff2-Sep-11 8:48
mveOriginalGriff2-Sep-11 8:48 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 8:53
dcof2-Sep-11 8:53 
GeneralMessage Removed Pin
2-Sep-11 9:28
professionalN_tro_P2-Sep-11 9:28 
GeneralRe: C# code for windows Pin
dcof2-Sep-11 18:08
dcof2-Sep-11 18:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.