Click here to Skip to main content
13,252,206 members (55,874 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Hey Guys,

i am trying to send email using and i got this SMTPException:

Failure sending mail.
{"Unable to read data from the transport connection: net_io_connectionclosed."}

and Her is My Code:

            //YAHOO SMTP Host (
            //GMAIL SMTP Host (
            //WINDOWS LIVE SMTP HOST (
            SmtpClient mySmtpClient = new SmtpClient("", 25);
            // set smtp-client with basicAuthentication
            mySmtpClient.UseDefaultCredentials = false;
            System.Net.NetworkCredential basicAuthenticationInfo = new
               System.Net.NetworkCredential("myEmail", "myPassword");
            mySmtpClient.Credentials = basicAuthenticationInfo;
            // add from,to mailaddresses
            MailAddress from = new MailAddress("From_Email", "Title");
            MailAddress to = new MailAddress("To_Email", "Test Email");
            MailMessage myMail = new System.Net.Mail.MailMessage(from, to);
            // set subject and encoding
            myMail.Subject = Email_Subject;
            myMail.SubjectEncoding = System.Text.Encoding.UTF8;
            // set body-message and encoding
            myMail.Body = Email_Body;
            myMail.BodyEncoding = System.Text.Encoding.UTF8;
            // text or html
            myMail.IsBodyHtml = true;
            return true;
        catch (SmtpException ex)
            return false;
        catch (Exception ex)
            return false;

Any Ideas????????????
Posted 12-May-13 3:40am
ThePhantomUpvoter 12-May-13 8:46am
Not every SMTP server uses the default port 25.
AmrDeif 12-May-13 8:56am
so what should i do???
AmrDeif 13-May-13 8:14am
Someone tell me what to do PLZ!!!!!

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 2

The Yahoo SMTP port is 465, not 25.

You also need EnableSsl set to true on the SmtpClient object.
AmrDeif 13-May-13 5:19am
Thanks Dave Kreskowiak for Your Reply
I've tried this but it didn't work
i've the same error
Unable to read data from the transport connection: net_io_connectionclosed
Dave Kreskowiak 13-May-13 12:54pm
The SmtpClient only supports one of the two SSL authentication methods available. Try disabling SSL and using port 587 instead.

Oh, and I'm seeing that you might need a Yahoo Plus account to use the SMTP servers.
AmrDeif 15-May-13 8:21am
the application sends emails and the email i send from (sender) is not valid after a number of right sending???
why is this?
does yahoo suspend email that sends more emails???
Dave Kreskowiak 15-May-13 8:24am
I have no idea what you mean by "is not vlaid after a number of right sending". That makes no sense.

But, if you mean you can no longer send emails, yes, you cannot use Yahoo for bulk mail. I don't know what the limit is per day. You will have to contact Yahoo Support for that information or whatever service they offer for such, if any.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web01 | 2.8.171114.1 | Last Updated 12 May 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100