Murugan.com
Murugan Andezuthu Dharmaratnam

  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  



Yahoo Mail ASP .NET System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

Home   ASP.NET   Yahoo Mail ASP .NET System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host         


System.Net.Mail.SmtpException: Failure sending mail. ---> System.IO.IOException: 
Unable to read data from the transport connection: An existing connection was forcibly closed 
by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was 
forcibly closed by the remote host
   at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   --- End of inner exception stack trace ---
   at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
   at System.Net.DelegatedStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.BufferedReadStream.Read(Byte[] buffer, Int32 offset, Int32 count)
   at System.Net.Mail.SmtpReplyReaderFactory.ReadLines(SmtpReplyReader caller, Boolean oneLine)
   at System.Net.Mail.SmtpReplyReaderFactory.ReadLine(SmtpReplyReader caller)
   at System.Net.Mail.SmtpReplyReader.ReadLine()
   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)
   --- End of inner exception stack trace ---
   at System.Net.Mail.SmtpClient.Send(MailMessage message)
   at SendMailYahoo._Default.Page_Load(Object sender, EventArgs e) in 
D:\Works\SendMailYahoo\SendMailYahoo\Default.aspx.vb:line 15

I am getting the follwoing error while I try to run this code below 


Imports System.Net.Mail

    Protected Sub Page_Load(ByVal sender As Object, 
ByVal e As System.EventArgs) Handles Me.Load
        Dim oMailMessage As New MailMessage("murugan_ad@yahoo.com", 
"murugan_ad@yahoo.com", "Subject", "Body")
        oMailMessage.To.Add("murugan_ad@yahoo.com")
        Dim oSmtpClient As New SmtpClient
        oSmtpClient.Host = "smtp.mail.yahoo.com"
        oSmtpClient.EnableSsl = True
        oSmtpClient.Port = "465"
        oSmtpClient.Credentials = New 
System.Net.NetworkCredential("murugan_ad@yahoo.com", "********")
        Try
            oSmtpClient.Send(oMailMessage)
        Catch ex As Exception
            TextBox1.Text = ex.ToString
        End Try
    End Sub

I tried every thing and finally this is my conclusion . Yahoo pop3 and smtp 
works only if you have a Yahoo! Mail Plus account. 

Here are some of the data below

# Client Settings: Is there a problem with your email client settings? 
Please make sure that you've configured your email client with these settings:

    * Incoming Mail (POP3) Server: plus.pop.mail.yahoo.com (Use SSL, port: 995)
    * Outgoing (SMTP) Server: plus.smtp.mail.yahoo.com (Use SSL, port: 465, use authentication)
    * Account Name/Login Name: your Yahoo! ID (your email address without the "@yahoo.com")
    * Email Address: your Yahoo! Mail address (e.g., user@yahoo.com)


Want to use another email program to send and receive Yahoo! Mail messages? 
If so, you'll be asked to designate a new incoming (POP3) mail server and a new 
outgoing (SMTP) mail server.

Here are the basic server settings for Yahoo! Mail:
Incoming Mail (POP3) Server:	plus.pop.mail.yahoo.com (Use SSL, port: 995)
Outgoing Mail (SMTP) Server:	plus.smtp.mail.yahoo.com (Use SSL, port: 465, use authentication)
Account Name/Login Name:	Your Yahoo! Mail ID (your email address without the "@yahoo.com")
Email Address:	Your Yahoo! Mail address (e.g., user@yahoo.com)
Password:	Your Yahoo! Mail password

If you can't add new POP or SMTP servers, you'll need to change your current server 
settings to access your Yahoo! Mail Plus account. Write down your current settings 
first—you might need to revert to them later if you decide to send and receive messages 
from your other email addresses.

Your other email program will give you the option of either deleting your Yahoo! messages 
from the Yahoo! server after downloading them, or leaving them on the Yahoo! server so 
you can see them online in your Yahoo! account, too.





  |  HOME   |  BLOG   |  TWITTER   |  ARTICLES   |  8086  |  C++   |  VC++   |  ASP .NET   |  VB .NET   |  JAVA SCRIPT   |  MS SQL   |  MY   |  VIDEOS   |  DOWNLOADS   |  CONTACT ME   |  

Copyright 2009 @ Murugan Andezuthu Dharmaratnam