Well, if you look at the rules, IM's & E-mail challenges are typically illegal....
However, if you read the rules on Formal Challenges, you are supposed to try all means to get a match BEFORE issuing a Formal Challenge.
Since IM's and E-mails are another way of trying to arrange such a match, they are truely NOT ILLEGAL as long as you fall into the range of being able to issue a Formal Challenge.