Programmatically add trading server by EA

 
I know there is a way to programmatically login to mt4 account using an EA, but what about adding a trading server (by trading server, I mean the server address, the third input field of the mt4 login popup window.)

 if there is no way to add new server address then maybe refreshing the current server addresses? (sometimes the servers are non responsive), when I run the EA it works just fine most of the times, it perfectly logs in the account, but sometimes it gives errors like "common error" "no connection" "invalid account" 
The Ea itself is perfect whatever the issue is its not at the EA end. 
 
In future please post in the correct section
I will move this topic to the MQL4 and Metatrader 4 section.
 

Most Demo accounts expire in 30 Day's or when you didn't log into them for x period of time then you get the invalid account and have to make a new one.

 
Marco vd Heijden:

Most Demo accounts expire in 30 Day's or when you didn't log into them for x period of time then you get the invalid account and have to make a new one.

well i dont think thats the issue here , because i made the demo account very recently and when i login to that account manually then everything works , but its just the auto login that mess up sometimes, not always just some times 

Reason: