Ad Code Sending Emails through YahooMail

sending email using yahoo

In previous article I explained How to Send Multiple Emails by Using Gmail Account. Now i show how to Send Emails through Yahoomail ID in by using C# coding and Resolve a SMTP Server Secure Connection and Authentication 5.5.1 Required Error | The SMTP Server Requires a Secure Connection or the Client was not authenticated.

In these Tutorials, we see how to sending email using Yahoo in, for sending email we use two class's i.e MailMessage Class and SMTPClient Class these two Class are predefined class from this namespaces (System.Net.Mail Namespace).

HTML Markup : Create Email Sending with Yahoo Page

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Sending-Mail-Yahoo.aspx.cs" Inherits="Mail_Sending_Mail_Yahoo" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="">
<head runat="server">
    <form id="form1" runat="server">
        <th colspan="2">
         Sending Mails through Yahoo...!!!
        <td style="width:20px;">To : </td>
        <td><asp:TextBox ID="txt_to_emailID" 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="Btn_sending_Yahoo" runat="server" 
                Text="Sending Mail Through Yahoo" onclick="Btn_sending_Yahoo_Click" /></td>

C# Coding

C# Coding : Sending Email with Yahoo Code

protected void Btn_sending_Yahoo_Click(object sender, EventArgs e)
        MailMessage ms = new MailMessage("Your Yahoo ID", txt_to_emailID.Text);
        ms.Subject = "Testing Sending Mail through Yahoo";
        ms.Body = txt_msg.Text;
        ms.IsBodyHtml = true;
        SmtpClient smtp = new SmtpClient("", 587);
        smtp.Credentials = new System.Net.NetworkCredential("Your Yahoo ID", "Your Yahoo Password");
        smtp.EnableSsl = true;

Next Tutorials : How to Resove SMTPException

The SMTP SEVER Requires Secure Connection or the Client was not Authenticated the Server Response was 5.5.1 Authentication Required

Post a comment