Problem with user creation using agsXmpp library

Here is my code.I am using agsXmpp library I can send message using this domain and port but can't create new user account on ejabberd server.

ejabberd in my local system and use my system local ip and define ip with domain in my windows hosts file.

string uname = "abc";
string domain_server = "mydomain";
string resource = "res1";
string password = "****";

Jid jid = new Jid(uname, domain_server,resource);

XmppClientConnection newCon = new XmppClientConnection(jid.Server,5222);

newCon.Server = domain_server;
newCon.Port = 5222;
newCon.AutoResolveConnectServer = true;
newCon.RegisterAccount = true;
newCon.ConnectServer = "mydomain";

newCon.OnLogin += delegate(object sender)
{
newCon.Close();
};

newCon.OnError += delegate(object sender, Exception ex)
{
newCon.Close();
};
newCon.OnAuthError += delegate(object sender, agsXMPP.Xml.Dom.Element e)
{

};

newCon.Open(jid.User, password);

Syndicate content