nlaugh Posted November 7, 2011 Share Posted November 7, 2011 I have an array for recipients 'recipients' => array( 'user@example.com', ), and I need to mail different recipients by form option, something like this switch($_POST['color']){ case 'red': $recipient = 'redperson@example.com'; break; case 'green': $recipient = 'greenperson@example.com'; break; case 'blue': $recipient = 'blueperson@example.com'; break; default: $recipient = 'user@example.com'; } I don't know how to combine the two? Quote Link to comment Share on other sites More sharing options...
nlaugh Posted November 7, 2011 Author Share Posted November 7, 2011 'recipients' => array( 'user@example.com', ), switch($_POST['color']){ case 'red': $recipient = 'redperson@example.com'; break; case 'green': $recipient = 'greenperson@example.com'; break; case 'blue': $recipient = 'blueperson@example.com'; break; default: $recipient = 'user@example.com'; } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.