I have used EA Sendmail to send mail from my Yahoo account. Please download from following link
EA Sendmail download
http://www.softpedia.com/get/Programming/Components-Libraries/EASendMail-SMTP-Component-NET-Edition.shtml
Here is the code to send mail
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Text;
using System.Collections.Generic;
using EASendMail; //add EASendMail
namespace
public partial class _Default :
System.Web.UI.Page
{
protected void
Page_Load(object sender, EventArgs e)
{
SmtpMail oMail = new SmtpMail("TryIt");
SmtpClient oSmtp = new
SmtpClient();
// Your yahoo email address
oMail.From
= "[email protected]";
// Set recipient email address
oMail.To = "[email protected]";
// Set email subject
oMail.Subject = "test email from yahoo
account";
// Set email body
oMail.TextBody = "this
is a test email sent from c# project with yahoo.";
// Yahoo SMTP server address
SmtpServer oServer = new
SmtpServer("smtp.mail.yahoo.com");
// For example: your email is "[email protected]",
then the user should be "[email protected]"
oServer.User
= "[email protected]";
oServer.Password = "password";
// Because yahoo deploys SMTP server on 465 port with
direct SSL connection.
// So we should change the port to 465.
oServer.Port = 465;
// detect SSL type automatically
oServer.ConnectType = SmtpConnectType.ConnectSSLAuto;
try
{
Response.Write("start to send email over
SSL ...");
oSmtp.SendMail(oServer, oMail);
Response.Write("Email was sent
successfully!");
}
catch (Exception ep)
{
Response.Write("failed to send email
with the following error:");
Response.Write(ep.Message);
}
}
}