Sending Multiple Emails Using Array

FORM:


 <div>

      <?

        $array_dpto = array(

                  1 => "Option 1", 

                  2 => "Option 2", 


                );

      ?>

      <?php echo CActiveForm::dropDownList($contact, 'dpto',$array_dpto,array('empty' => 'Dpto','class' => 'dpto'));  ?> </div>

MODEL:


 if ($array_dpto == 'Option 1') {

                  $message->addTo('email@email.com');

                  $message->addTo('email2@email.com');

                }

What do you mean bro? Try to make your question clear please :)

I have in my contact form, select one to choose the business department, and each department has a different email, I put in an array, but is not sending.

Example:

"Option 1" send email to email@email.com;

"Option 1" send email to email@email.com;

"Option 2" send email to usa@email.com;

"Option 3" send email to thiago@email.com;

understand?


if ($array_dpto == 'Option 1') {

           $message->addTo('email@email.com');

           $message->addTo('email2@email.com');

}

And what is the class of $message?

Does your sendmail work correctly?