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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:03:34+00:00 2026-06-11T15:03:34+00:00

Have a look at my email code behind. protected void Button1_Click(object sender, EventArgs e)

  • 0

Have a look at my email code behind.

 protected void Button1_Click(object sender, EventArgs e)
{

    try
    {
        MailMessage mail = new MailMessage();
        mail.To.Add("color.shadow@yahoo.com");

        mail.From = new MailAddress("abc@gmail.com");
        mail.Subject = "Reservation Status";

        string Body = "Greeting from us." +
                      " You may view your booking details at your profile now." +
                      " Have a nice day." +
                      "Thank you.";
        mail.Body = Body;

        mail.IsBodyHtml = true;

        SmtpClient smtp = new SmtpClient("localhost", 25);
        smtp.Host = "smtp.gmail.com"; 
        smtp.Credentials = new System.Net.NetworkCredential
             (abc@gmail.com", "abcdef");

        smtp.DeliveryMethod = SmtpDeliveryMethod.Network;
        smtp.EnableSsl = true;

        smtp.Send(mail);
        Label1.Text = "Mail Send...";
    }
    catch (Exception ex)
    {
        Label1.Text = ex.Message;
    }
}

In this code, I have to manually enter the receiver email. My question is how to get email entered onto text box instead of mail.To.Add("color.shadow@yahoo.com");
Thanks in advance!

  • 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-11T15:03:35+00:00Added an answer on June 11, 2026 at 3:03 pm

    Change mail.To.Add("color.shadow@yahoo.com"); to mail.To.Add(textBoxEmail.Text); if you have created a textbox called textBoxEmail.

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

Sidebar

Related Questions

A VB6 applications sends a HTML email. Please have a look at the code
Please have a look at the following code package email; import java.awt.*; import java.awt.event.*;
I often see a pattern used in circumstances where we have look-up code that
Have a look here: In the following code, what would be the type of
Have a look at the following code you are not required to read the
I have about 20 CSV's that all look like this: [email],[fname],[lname],[prefix],[suffix],[fax],[phone],[business],[address1],[address2],[city],[state],[zip],[setdate],[email_type],[start_code] What I've been
Can anyone have a look at the php code I wrote. I want to
Please have a look at the following code package vcardtest; import java.io.*; import java.util.Iterator;
TEST SITE Look here to see code in action I have two arrays which
I have this short and simple code for sending an email notification to the

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.