First of all, this was supposed to pe a programming question ( in c# ). But I decided to post it in this forum for reasons I'll explain later.
Last week, I had created a program that sends an eamil through an SMTP server. The code worked all the time and didn't have any problems any time. Although you won't need the code, here it is:
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Net;
using System.Net.Mail;
using System.Drawing;
using System.IO;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
try
{
MailMessage message = new MailMessage();
message.From = new MailAddress("[email protected]");
message.To.Add("[email protected]");
message.Subject = "afdasdfasfg";
message.Body = "Hgfk4564267862738I";
message.IsBodyHtml = true;
message.Priority = MailPriority.High;
SmtpClient sC = new SmtpClient("smtp.mail.yahoo.com");
sC.Port = 587;
sC.Credentials = new NetworkCredential("myid", "mypassword");
//sC.EnableSsl = true;
sC.Send(message);
MessageBox .Show ("Mail Send Successfully");
}
catch (Exception ex)
{
MessageBox .Show (ex + "Mail Sending Fail's") ;
}
}
}
}
Now, as I said this worked perfectly until around four days ago when I just tried it and the program just threw up this 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 64.202.165.58:25 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot,
SocketAddress socketAddress) at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP) 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(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)
Now, I know 100% that the problem is not with the code for two reasons:
1.The code worked perfectly for a whole week (I didn't change anything ).
2. Today, I tried the program on another computer at my school and it worked perfectly.
So basically, the problem is something with my computer because the program works fine on another computer. And, the program used to work on my computer for a whole week.
That's why I don't don't need any code help. Could someone explain all this to me. What could possibly be wrong with my computer. Please help ( very urgent).
Thanks for your help!

New Topic/Question
This topic is locked


MultiQuote



|