code to send email

Posted by Alexander on Stack Overflow See other posts from Stack Overflow or by Alexander
Published on 2010-04-04T17:00:44Z Indexed on 2010/04/04 17:03 UTC
Read the original article Hit count: 381

Filed under:
|
|
|

What am I doing wrong here?

 private void SendMail(string from, string body)
    {
        string mailServerName = "plus.pop.mail.yahoo.com";
        MailMessage message = new MailMessage(from, "[email protected]", "feedback", body);
        SmtpClient mailClient = new SmtpClient();
        mailClient.Host = mailServerName;
        mailClient.Send(message);
        message.Dispose();
    }

I got the following error:

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 209.191.108.191:25

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about c#