Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7518435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:44:59+00:00 2026-05-30T01:44:59+00:00

I am able to ping smtp.mail.yahoo.com from my system but when i send email

  • 0

I am able to ping smtp.mail.yahoo.com from my system but when i send email from following code using yahoo address it gives error transport failed to connect to server.
The same code successfully sends the email from gmail account.

I am using port 465 for yahoo.

    MailMessage oMsg = new MailMessage();
    oMsg.From = from.Text;
    oMsg.To = to.Text;
    oMsg.Subject = "Hi";
    oMsg.BodyFormat = MailFormat.Html;
    oMsg.Body = msg.Text;


    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserverport", port);
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpserver", host);
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusing", 2);

    WebProxy proxy = WebProxy.GetDefaultProxy();
    if (proxy.Address != null)
    {
        oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/urlproxyserver", proxy.Address.Host);
        oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/proxyserverport", proxy.Address.Port);
    }
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpusessl", true);
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate", "1");
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendusername",from.Text);
    oMsg.Fields.Add("http://schemas.microsoft.com/cdo/configuration/sendpassword", pass.Text);


    // ADD AN ATTACHMENT.

    /*  MailAttachment oAttch = new MailAttachment(path+ "\\Image.bmp", MailEncoding.Base64);

    oMsg.Attachments.Add(oAttch);*/

    SmtpMail.SmtpServer.Insert(0,host);
    if (proxy.Address != null)
        MessageBox.Show("Sending via proxy settings: " + proxy.Address.ToString());
    try
    {                
        SmtpMail.Send(oMsg);
    }
    catch (Exception ex)
    {
        MessageBox.Show(ex.Message);
    }
    oMsg = null;

Any ideas why this error occurs?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:45:00+00:00Added an answer on May 30, 2026 at 1:45 am

    Being able (or not) to ping a host does not say anything about whether you will be able to connect to a particular service on it. For that, you need to try to actually establish a connection. (And of course, the fact that you can establish a connection does not necessarily imply that the service in question is working properly.)

    Usually, it’s a good idea to use telnet to try connecting to the remote host on the port in question. The syntax on the command line is simply telnet host.fqdn.example.com portnumber. This will tell you if there is anything at all at the other end of the pipe responding to connection attempts, which is a first step in determining where the problem is.

    Second, it’s usually a good idea to trim the code to the minimal version that exhibits the problematic behavior, and include the full code to show the problematic behavior. You are using a number of variables in your code which we really know nothing about.

    Some ISPs block outgoing connections to the SMTP ports on hosts other than their own mail servers, to reduce the amount of outgoing spam. Maybe there is a typo in the value in host? Maybe you are inadvertantly using some unexpected MailMessage implementation? And so on.

    That said, I would definitely first try to connect to the mail server in question manually, through a proxy if you are using one to connect using that code. If that doesn’t work either, then your problem at least has nothing to do with the code in the question, and you can look elsewhere (in which case one possible candidate would be ISP filters; maybe they have a list of allowed external SMTP hosts and Yahoo’s isn’t on it?).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

the VMware is able to ping the gmail server. sample code MailMessage mail =
I would like to be able to perform a ping and traceroute from within
Application able to record error in OnError, but we are not able to do
I'm able to connect to and read an excel file no problem. But when
I need to be able to monitor the speed of my internal network using
After I upgraded using a clean install from OS X 10.5 to 10.6.2 and
I want to be able to send messages to a remote JBoss server (JBoss
While trying to figure out the best method to ping (ICMP) something from python,
I'm able to ping the remote server I am attempting to connect to successfully.
I have following code for testing the server connectivity. I have a device that

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.