title: Error sending mail through Yahoo?
body: <p>Error sending email from yahoo. I have tried ports 25,995,465,587! I am out of options now. I would highly appreciate if someone could tell me what the problem is? isn't smtp available on yahoo now!!! i read somewhere that it is a paid service or something? is that correct and is it because of that, that i am not able to get through the server! I can successfully send emails from my gmail account where the To and From are same and i also sent a mail from gmail to Yahoo but the reverse isnt working!</p>
  
  <pre><code> MailMessage mail = new MailMessage();
   mail.From = new MailAddress(something@yahoo.co.in);
   //***Enter recievers Email here (TVC)
   mail.To.Add(new MailAddress("something@gmail.com"));
   mail.Subject = "This is some text";
   mail.Body = "This is the body";
   SmtpClient client = new SmtpClient("plus.smtp.mail.yahoo.com",995);
   client.Credentials = new System.Net.NetworkCredential("somehting@yahoo.co.in", "pass");
   client.EnableSsl = true;
   client.Send(mail);
   MessageBox.Show("Mail Sent Successfully!", "Success", MessageBoxButtons.OK);
  </code></pre>
  
  <p>I get the following exception</p>
  
  <pre><code>System.Net.Mail.SmtpException was unhandled
  Message=Failure sending mail.
  Source=System
  StackTrace:
     at System.Net.Mail.SmtpClient.Send(MailMessage message)
     at WindowsFormsApplication1.frmSelfAssessment.mailToTVC()
     at WindowsFormsApplication1.frmEnterEmail.button1_Click(Object sender, EventArgs e)
     at System.Windows.Forms.Control.OnClick(EventArgs e)
     at System.Windows.Forms.Button.OnClick(EventArgs e)
     at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
     at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ButtonBase.WndProc(Message&amp; m)
     at System.Windows.Forms.Button.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
     at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.RunDialog(Form form)
     at System.Windows.Forms.Form.ShowDialog(IWin32Window owner)
     at System.Windows.Forms.Form.ShowDialog()
     at WindowsFormsApplication1.frmSelfAssessment.btnSubmit_Click(Object sender, EventArgs e)
     at System.Windows.Forms.Control.OnClick(EventArgs e)
     at System.Windows.Forms.Control.WmMouseUp(Message&amp; m, MouseButtons button, Int32 clicks)
     at System.Windows.Forms.Control.WndProc(Message&amp; m)
     at System.Windows.Forms.ScrollableControl.WndProc(Message&amp; m)
     at System.Windows.Forms.UserControl.WndProc(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message&amp; m)
     at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message&amp; m)
     at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
     at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG&amp; msg)
     at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
     at System.Windows.Forms.Application.Run(Form mainForm)
     at WindowsFormsApplication1.Program.Main()
     at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
     at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
     at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
     at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
     at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
     at System.Threading.ThreadHelper.ThreadStart()
     InnerException: System.IO.IOException
     Message=Unable to read data from the transport connection: net_io_connectionclosed.
     Source=System
     StackTrace:
          at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
          at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
          at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
          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)
     InnerException:
  </code></pre>
  
  <p>And after using the try catch block this is what i get</p>
  
  <pre><code>System.Net.Mail.SmtpException: Failure sending mail. ---&gt; System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.
  at System.Net.Mail.SmtpReplyReaderFactory.ProcessRead(Byte[] buffer, Int32 offset, Int32 read, Boolean readLine)
  at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
  at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
  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 WindowsFormsApplication1.frmSelfAssessment.mailToTVC() 
  </code></pre>