There are several ways to handle this...
For starters, on reply, I typically add <input type="hidden" name="mailtoID" value=" some player ID ">. This eliminates the hassle of the player having to type out the players name. It can also find the player much faster in the database as playerIDs are indexed.
For sending, I allow players to type in names, and comma delimmiate. Ie, player1; player2; player3. I dislike this as I have to search a varchar field, but its necessary imo.
I'm not sure why there would need to be an Ajax call... though this could be added. Typically, I allow the player to try to submit the message, and if it has no recipients (or fails to reach a recipient), I store the message in $_SESSSION['Msg'];, echo this session value between <textfield> and </textfield>, and throw the error of who the message could not reach.
Finally, I like to limit the number of messages a player can send per day. Not only is it a good paid for premium feature to allow additional messages, but messaging takes up a lot of server resources that can get easily abused via spam.