3

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!

 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);

I get the following exception

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& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& 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& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
   at System.Windows.Forms.UserControl.WndProc(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
   at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& 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:

And after using the try catch block this is what i get

System.Net.Mail.SmtpException: Failure sending mail. ---> 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() 
Tanmay
  • 341
  • 2
  • 6
  • 22

3 Answers3

2

I don't think you can do that unless you are a Yahoo! Plus account holder.

Read this: http://help.yahoo.com/l/us/yahoo/mail/classic/mailplus/pop/pop-08.html

This is the link: Time out Error in send mail
( OP never believed it any way and so it was not marked as answer. Please note that the other answer is also unmarked which means OP did not get a solution )

P.S: I have just checked sending a mail through "smtp.yahoo.com" port 465. Its also being forcibly closed. So as of now, its also not working.

Hope this helps.

Community
  • 1
  • 1
naveen
  • 53,448
  • 46
  • 161
  • 251
  • -1 for YAHOO..i think that is the problem then. i will have to check with someone who has a plus account. sad stuff these guys make. Why the hall cant things be open source. boiling with anger right now – Tanmay Aug 17 '11 at 13:35
  • i am digging out a post of mine on this issue. it was more detailed. searching... – naveen Aug 17 '11 at 13:36
  • that would be great help for me indeed. Thank you so much – Tanmay Aug 17 '11 at 13:39
  • i think CDOSYS is the answer and i need to add a reference to that dll and use the code here [link](http://support.microsoft.com/kb/310212) – Tanmay Aug 17 '11 at 13:57
0

A good place to start would be to try to do it manually. Just connect to that server on port 25 using telnet go through the commands as described on this page.

That way you can see how far you get before it breaks.

Hans Olsson
  • 54,199
  • 15
  • 94
  • 116
  • @qua: He did say that he'd tried to connect to it on port 25. I know nothing about yahoo mail servers so only gave some generic advice (it's not uncommon for a mail server to support both with and without SSL and it's then easier to test without SSL first). – Hans Olsson Aug 17 '11 at 13:18
  • @tzup: If yahoo's mail server supports SMTP on port 25, then you should be able to connect in to it via telnet. SMTP is just text commands so it's quite easy to send an email manually. – Hans Olsson Aug 17 '11 at 13:23
  • i have tested with ssl enabled set to false also..still it doesnt work – Tanmay Aug 17 '11 at 13:27
  • @tanmay: Have you checked the links Reggie added, they contain what seems to be some kind of solutions to your issue. Btw, as far as I can tell, port 995 is for POP3S so is not relevant in any way. – Hans Olsson Aug 17 '11 at 13:40
  • i checked those solutions and the only thing i could figure out was that i should use 465 instead of 995 and also that (probably) yahoo supports only implicit ssl and .net supports only explicit ssl and that is where the two clash giving me a failure notice. i there some thing that i am missing – Tanmay Aug 17 '11 at 13:46
  • @ho1 CDOSYS seems to be the answer i guess. a guy here got it working with it. So i am currently trying that out. – Tanmay Aug 17 '11 at 13:55
  • @ho1 let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/2582/discussion-between-tanmay-and-ho1) – Tanmay Aug 17 '11 at 15:12
  • @tanmay: Just be aware that as far as I know CDO is deprecated, so I'd be careful about using it for anything that I want to make futureproof. – Hans Olsson Aug 17 '11 at 15:15
  • @ho1 sorry i read that late that is why couldnt come on chat. I found an alternative. It is a work around actually. What i am thinking of doing now is using the same address (probably a domain i buy) for sending and receiving mail. If you have a better solution please do let me know. the way i will differentiate between is using their name or some other text to identify them and adding it to the body or the subject of the mail. – Tanmay Aug 17 '11 at 16:21
0

If you wrap the code in a try / catch block and debug the exception you'll get a more meaningful message telling you what the problem is.

Chris Snowden
  • 4,982
  • 1
  • 25
  • 34