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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:19:59+00:00 2026-06-09T03:19:59+00:00

I have a problem with a form, I can’t send it. If I put

  • 0

I have a problem with a form, I can’t send it. If I put wrong details (secure code, email, empty fields etc.), I get errors on screen, which is correct.

But when I enter all correct data, I can’t send the form, I get this error:

There was an error submitting your form. Please check the following:

But the list is empty.

    SmtpClient smtpClient = new SmtpClient();
    MailMessage message = new MailMessage();
    try
    {
        MailAddress fromAddress = new MailAddress("noreply@domain.com", "string1");
        // decide who message goes to
        string emailGoesTo = "person1@domain.com";

        MailAddress toAddress = new MailAddress(emailGoesTo.ToString(), "string1");

        message.From = fromAddress;
        message.To.Add(toAddress);
        message.To.Add("person2@domain.com");
        message.Subject = "string2";
        message.Body = "New Website Contact Request";
        message.Body += "------------------------------------------\r\n";
        message.Body += "Name: " + your_name.Text + "\r\n";
        message.Body += "Email: " + your_email.Text + "\r\n";
        message.Body += "Telephone: " + your_telephone.Text + "\r\n";
        message.Body += "Company: " + your_company.Text + "\r\n";
        message.Body += "Address: " + your_address.Text + "\r\n";
        message.Body += "Postcode: " + your_zip.Text + "\r\n";
        message.Body += "Enquiry: " + your_enquiry.Text + "\r\n";

        // smtpClient.Host = "string3";
        smtpClient.Host = "string4";
        smtpClient.Credentials = new System.Net.NetworkCredential("string5", "string6");
        smtpClient.Send(message);
        Response.Redirect("thankyou.aspx");
    }
    catch (Exception ex)
    {
        statusLabel.Text = "Coudn't send the message!";
    }

I’m noobie, so is there any1 string5 & string6 please?

Also what is wrong? How to make this form working?

  • 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-06-09T03:20:02+00:00Added an answer on June 9, 2026 at 3:20 am

    never tried to use smtpclient.host but the below works. Just need to add in the ip/host name of the mail server and make sure it is set up to allow relay from the machine calling the code. and replace the strings with the text you want. I’d suggest starting with something simple rather than feeding from form fields to eliminate any outside issues. Once the mail is sending then start adding additional pieces in.

        public static string mailServer = 'IP address or host name of mail server'
        public static void Send()
        {
            string subject = "test subject";
            string address =  "test@somedomain.com";
            string body = "some mail body";
            MailMessage mm = new MailMessage();
            mm.From = new MailAddress("no-reply@domain.net"); //on behalf of
            mm.To.Add(new MailAddress(address));
    
    
            mm.IsBodyHtml = true;
            mm.Subject = subject;
            mm.Body = body;
            SmtpClient server = new SmtpClient(mailServer);
            server.Send(mm);
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a form containing name,email,message and captcha fields. I can submit the form
I have problem with TinyMCE editor. I have form with few text fields and
I have problem with ajax and php.I have next code $(form).submit(function() { var poruka
I have a problem I can not resolve on a form Here's my view:
I have this problem: My web application has a form where the users can
I have a problem similar to this one: How can I execute code after
I have problem with repopulating form_upload after validation. Other input fields or selectboxes are
I have problem SIMILAR to preventing form data reposting, but not quite the same
I have problem with a long form in iOS. The form itself is done
I have problem with show or hide form in Window Form Application. I start

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.