How do I chose recipient email address depending on textfield value? I have created a webform which has a "Reference number" textfield.

When someone types 101 in that textedfield, the submitted form should be send to example@gmail.com; if someone types 777, the submitted form should be send to example222@gmail.com.

Is there a way to achieve this?
The first solution that comes to my mind will be using hook_form_alter.
and take the value of the field.
Based on the value, send the mail to appropriate address.

But most likely there will be a module for that.
Meanwhile..

http://agileadam.com/webform-mail-alter
can be of service

Regards

Oleg