added dropdown list item to contact mail

Last post 05-24-2009 11:03 AM by RaeKC. 2 replies.

Sort Posts:

  • added dropdown list item to contact mail

    05-23-2009, 8:33 PM
    • Member
      55 point Member
    • RaeKC
    • Member since 11-28-2008, 5:52 PM
    • Posts 338

    Hi:
    I added a drop down list to my contact form with various subjects for the user to pick when sending the contact form, and if none apply, it has an "other" choice in bottom of list.

    It doesn't show up in the emails I'm getting. Looking over the contact form and the webconfig file, I couldn't figure out what I needed to add / change to have the email I receive, include the drop down list choice the user picked.

    Can any one help out as to where i need to look or help me with it if its something that has to be added?

    RAchel

  • Re: added dropdown list item to contact mail

    05-23-2009, 10:46 PM
    Answer
    • Contributor
      6,366 point Contributor
    • Lee Dumond
    • Member since 11-03-2004, 2:51 PM
    • Decatur, IL USA
    • Posts 1,168

     

    MailMessage msg = new MailMessage();
    msg.IsBodyHtml = false;
    msg.From = new MailAddress(txtEmail.Text, txtName.Text);
    msg.To.Add(new MailAddress(Globals.Settings.ContactForm.MailTo));
    if (!string.IsNullOrEmpty(Globals.Settings.ContactForm.MailCC))
       msg.CC.Add(new MailAddress(Globals.Settings.ContactForm.MailCC));
    msg.Subject = myDropDownList.SelectedItem.Text;  // this line changed 
    msg.Body = txtBody.Text;
     
  • Re: added dropdown list item to contact mail

    05-24-2009, 11:03 AM
    • Member
      55 point Member
    • RaeKC
    • Member since 11-28-2008, 5:52 PM
    • Posts 338

     Thanks so much!Yes

    Rachel

Page 1 of 1 (3 items)