Menu

Select Email Recipient -from dropdown

Help
SSwan
2008-10-07
2013-06-03
  • SSwan

    SSwan - 2008-10-07

    I am creating a form that allows people to ask a doctor a question. I have Name, Email, Question and Doctor fields.  I would like the form to be emailed  to the doctor selected from the dropdown field.  Is this possible?

    Thanks a million

     
    • TNTEverett

      TNTEverett - 2008-10-07

      Easy.

      <select name="variable_name">
              <option selected>default_name</option>
              <option>name_1</option>
              <option>name_2</option>
      </select>

       
    • SSwan

      SSwan - 2008-10-07

      How would I tell my form to send the form to the doctor listed in the list I create?  When setting up the form, there is a spot to put in where the form emails to but I would like it to email one of the two doctors in the option list.

       
      • TNTEverett

        TNTEverett - 2008-10-07

        Find the mail() function in the processor.php file.

        if($doctor=="doctor_1") {
        mail("doctor_1_email",....)
        } else if ($doctor=="doctor_2") {
        mail("doctor_2_email",....)
        } else {
        mail("my_email",....)
        }

         
    • SSwan

      SSwan - 2008-10-07

      Thank you soooooooooooooo much -- it worked perfectly!!  I truly appreciate you help on this.  I hope you have a WONDERFUL day!!!

      Sharron

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.