HI if the iphone is locked with AT&T network then until you unlock it you can't use it with t-mobile sim ..You can easily unlock your iphone with the help of providers like Prounlocking.com here they will unlock your iphone using remote unlocking service for affordable cost .....