Author: doyler | Posted on: 4/6/2009 3:43:32 PM | Views : 520

Hi



I'm using C# and Visual Studio 2008



I have a form that people fill out, that has a Dropdown List at the top.



When they click send I want it to send to a specific email address depending on the selection they made in the Dropdown List.



Here is the code I have and it works but just sends it to the one email address "support@sample.com":



using (MailMessage message = new MailMessage())

{

message.From = new MailAddress(txtCompanyName.Text.ToString());

message.To.Add(new MailAddress("support@sample.com"));

message.Subject = txtCompanyName.Text.ToString();

message.Body = txtInformation.Text.ToString();

SmtpClient client = new SmtpClient();

client.Host = "cp";

client.Send(message);



}



C ...

Go to the complete details ...