0

I have 3 textboxes..textBox1,textBox2,textBox3.I want that when user clicks on submit button all data should go to e-mail address..

Any one here can please help me to get through code?

Thanks very much

3
Contributors
4
Replies
5
Views
8 Years
Discussion Span
Last Post by darcee
0

All data goes to the email address? What do you mean? Do you mean that you will send the email to three diferrent email addresses?

If that's the case, you do it this way:

SmtpClient smtp = new SmtpClient("smtpaddress");
smtp.Credentials = new NetworkCredentials("username","password");

MailMessage message = new MailMessage();

message.From = new MailAddress("YourEmailAddress");

message.To.Add(new MailAddress(textbox1.Text));
message.To.Add(new MailAddress(textbox2.Text));
message.To.Add(new MailAddress(textbox3.Text));

message.Subject = "Subject";
message.Body = "Body";

smtp.Send(message);
0

nope

I need that text which is entered in textBox1,textBox2 and textBox3 should go in e-mail address

Thanks

0

nope

I need that text which is entered in textBox1,textBox2 and textBox3 should go in e-mail address

Thanks

Again, I'm not 100% clear of your question. Why don't you use my code, but chage this one!

message.To.Add(new MailAddress(textbox1.Text + textbox2.Text + textbox3.Text));
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.