Well to send message to a contact knowing his email...
1) Iterate the contact list object
2) Match the email you want with the contact's object
3) Use the OpenChat function sending the contact you found
4) Check if the chat window was opened
5) Send your message with the SendMessage function.
code:
var strEmail = "email@email.com";
var strMsg = "msg you want to send";
var Contacts = Messenger.MyContacts;
var e = new Enumerator(Contacts);
for(; !e.atEnd(); e.moveNext())
{
var Contact = e.item();
if (Contact.Email == strEmail) {
var ChatWnd = Messenger.OpenChat(Contact);
if(ChatWnd != "null") {
ChatWnd.SendMessage(strMsg);
} else {
//actions in case it could not open the chat
}
}
}
I wrote this from the top of my head so I might have missed something. I'm sure someone will correct me if I'm wrong or if there's a better method. Didn't test the code. But I'm sure this will give you a clue on which direction to go. Have fun!