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 3873426
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:02:07+00:00 2026-05-19T22:02:07+00:00

I have found this site very useful for all my previously faced problems, However

  • 0

I have found this site very useful for all my previously faced problems, However i couldnt get help with the following.

I have developed a website which is able to send emails. On localhost this works absolutely fine. when i say localhost, i am able to recive the emails sent, but when i upload onto server i face this error when it starts the process of sending emails.

“A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond IPADDRESS:PORT”

Tried ping on the adrress for the port and ping is working.

Here is the code

string strFrm = ConfigurationManager.AppSettings["FromAddress3"].ToString();

string[] receive = {"emailaddress1","emailaddress2","emailaddress3","emailaddress4"};

string subject = "New registration";

string body = "<html><head><title>Registered Candidates</title></head><body>bla bla bla</body></html>";

//I however have put reg exp validator on the form

if(txtEmail.Text.Contains("@") && txtEmail.Text.Contains("."))
{
    for (int i = 0; i <= receive.Length - 1; i++)
    {
        MailMessage msg = new MailMessage(strFrm, receive[i], subject, body);
        msg.IsBodyHtml = true;

        SmtpClient client = new SmtpClient();

        client.Send(msg);
     }

     Response.Redirect("Thankyou.html");

Web.config

<mailSettings>
  <smtp from="from address">
    <network host="server" port="25"
userName="username" password="password"  />
  </smtp>
</mailSettings>

Please help. I upload onto my server via precompilation of the site and upload the files.

  • 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-19T22:02:07+00:00Added an answer on May 19, 2026 at 10:02 pm

    Solved.. 😀

    My hosting server was godaddy and my hosting plan supported only age old system.web.mail i.e CDOSYS concept.

    Here is the code.

    using System.Web.Mail;
    
    private void SendEmail()
    {
    const string SERVER = "relay-hosting.secureserver.net";
    MailMessage oMail = new System.Web.Mail.MailMessage();
    oMail.From = "emailaddress@domainname";
    oMail.To = "emailaddress@domainname";
    oMail.Subject = "Test email subject";
    oMail.BodyFormat = MailFormat.Html; // enumeration
    oMail.Priority = MailPriority.High; // enumeration
    oMail.Body = "Sent at: " + DateTime.Now;
    SmtpMail.SmtpServer = SERVER;
    SmtpMail.Send(oMail);
    oMail = null; // free up resources
    }
    

    Thanks Jakob for participating actively! 🙂

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

Sidebar

Related Questions

I have a section on my site very similar to this site: http://www.royalways.com/index.html however
I have found this answer really useful. It helps me plot network/graphs and select
I've tried lots of code that I have found on this site, but none
My very first post here! I have been using this site for many years
I found this site/tutorial/demo from another question here on SO. Very nice and clean
Found this snippet on a site that is very well designed (http://www.distinctlydeutschland.com/): @font-face {
I'm using EF 4 on my web site and have found a very disturbing
I have found this link: http://www.jfree.org/forum/viewtopic.php?f=3&t=6314 Its back in 2007 where they agree that
I have found this line of MatLab code on the internet that displays a
I have found this project on Codeplex. http://www.codeplex.com/ProjNET I need to integrate this code

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.