c# .net

How to send yahoo email in asp.net c# uses smtp server yahoo?

How to send yahoo email in asp.net c# uses smtp server yahoo?, someone asked me to explain?

In this article I will show you how to send email using asp.net c#. You need to configure the yahoo mail smtp server in SmtpClient class from the namespace System.Net.Mail.

HTML Markup:

<form id="form1" runat="server">
                    <th colspan="2">Sending Mails using Yahoo...!!!
                    <td style="width: 40px;">To : </td>
                        <asp:TextBox ID="txtEmailId" runat="server" Width="310px"></asp:TextBox></td>
                    <td colspan="2">
                        <asp:TextBox ID="txt_msg" runat="server" TextMode="MultiLine" Height="149px"
                    <td colspan="2">
                        <asp:Button ID="sentmail" runat="server"
                            Text="Sending Mail using Yahoo" OnClick=" btnSentMail" /></td>

C# coding:

protected void btnSentMail(object sender, EventArgs e)
        MailMessage ms = new MailMessage("your yahoomail id", txtEmailId.Text);
        ms.Subject = "Testing Sending Mail through Yahoo";
        ms.Body = txt_msg.Text;
        ms.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient("smtp.mail.yahoo.com", 587);
        smtp.Credentials = new System.Net.NetworkCredential("your yahoomail id ", "your password");
        smtp.EnableSsl = true;


yahoo send email using asp.net


If you’re getting error “smtp server requires a secure connection 5.5.1”. It will be resolved by the following way click SMTP server requires a secure connection or the client was not authenticated

Post your comments / questions