I want to send email in asp.net using my yahoo account
I want to the know the SMTP server name of yahoo and the port number to use .
Like for gmail i know .its "" and port 587

Whats in case of Yahoo...??
In gmail its free to send...Is it that yahoo CHARGES for sending emails...heard somewhere..it a nt sure...
Is it possible to send email using YAHOO...
Help me out?

Dani AI

Generated

For clarity and an up-to-date summary that complements the posts from , , and :

The official outgoing SMTP server for Yahoo Mail is smtp.mail.yahoo.com. It accepts secure connections (SSL/TLS) and typically uses port 465 (SSL) or 587 (TLS/STARTTLS); authentication is required. Current Yahoo documentation lists these server/port/security requirements. Yahoo Mail IMAP/SMTP settings. (en-global.help.yahoo.com)

Accounts protected by two-step verification require an app-specific password (or an OAuth2 flow) for third‑party apps; the app-password workflow and generation steps are documented by Yahoo under Account Security. If authentication fails, confirm Account Security settings and use an app password rather than the main account password for non‑web clients. Generate and manage 3rd‑party app passwords. (help.yahoo.com)

For modern .NET apps prefer MailKit (supports explicit SSL, STARTTLS and OAuth2) instead of the legacy System.Net.Mail.SmtpClient. Example (MailKit):

using MimeKit;
using MailKit.Net.Smtp;
using MailKit.Security;

var msg = new MimeMessage();
msg.From.Add(MailboxAddress.Parse("sender@yahoo.com"));
msg.To.Add(MailboxAddress.Parse("recipient@example.com"));
msg.Subject = "Test";
msg.Body = new TextPart("html") { Text = "<p>hello</p>" };

using var client = new SmtpClient();
client.Connect("smtp.mail.yahoo.com", 465, SecureSocketOptions.SslOnConnect);
client.Authenticate("sender@yahoo.com", "YOUR_APP_PASSWORD");
client.Send(msg);
client.Disconnect(true);

MailKit docs and examples. (mimekit.net)

Operational notes: Yahoo does not publish fixed public bulk‑send limits (if a limit is hit, the account is paused and a wait period is shown). For recurring or high‑volume sending, a dedicated transactional provider or a Yahoo Business/Plus plan (which may use alternate server names) is recommended. [Yahoo sending limits / business notes]. (help.yahoo.com)

Summary tie‑in: s 2010 SmtpClient approach (port 587, TLS) reflected a working pattern for that time/region; current official guidance uses smtp.mail.yahoo.com with SSL/TLS and app passwords or OAuth2 for secure authentication. (en-global.help.yahoo.com)

Recommended Answers

All 3 Replies

Try this . It describes how to send email using yahoo business account.

/* yahoo */
    public bool SendYahooMail(string sToEmail, string sFromEmail, string sHeader, string sMessage,string Password)
    {
        SmtpClient client = new SmtpClient();
        client.DeliveryMethod = SmtpDeliveryMethod.Network;
        client.EnableSsl = true;

        client.Host = "smtp.mail.yahoo.co.in";
        client.Port = 587;

        // setup Smtp authentication

        System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(sFromEmail, Password);
        client.UseDefaultCredentials = false;
        client.Credentials = credentials;

        System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
        msg.From = new MailAddress(sFromEmail);
        msg.To.Add(new MailAddress(sToEmail));

        msg.Subject = sHeader;
        msg.IsBodyHtml = true;
        msg.Body = string.Format(sMessage);
        try
        {
            client.Send(msg);
            return true;
        }
        catch (Exception ex)
        {
            return false;            
        }

    }
    /* Gmail*/
    public bool SendGmailMail(string sToEmail, string sFromEmail, string sHeader, string sMessage,string Password)
    {
        SmtpClient client = new SmtpClient();
        client.DeliveryMethod = SmtpDeliveryMethod.Network;
        client.EnableSsl = true;

        client.Host = "smtp.gmail.com";
        client.Port = 587;

        // setup Smtp authentication

        System.Net.NetworkCredential credentials = new System.Net.NetworkCredential(sFromEmail, Password);
        client.UseDefaultCredentials = false;
        client.Credentials = credentials;

        System.Net.Mail.MailMessage msg = new System.Net.Mail.MailMessage();
        msg.From = new MailAddress(sFromEmail);
        msg.To.Add(new MailAddress(sToEmail));

        msg.Subject = sHeader;
        msg.IsBodyHtml = true;
        msg.Body = string.Format(sMessage);
        try
        {
            client.Send(msg);
            return true;
        }
        catch (Exception ex)
        {
            return false;            
        }

    }
    //
commented: Good answer, shame about the lack of [CODE] tags +1

Sending Email with Yahoo in Asp.NET

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.