Before you able to use imessage you must activate it first and sometime imessage activation not success and show error notification such as “could not sign into imessage” or “error with imessage activation” if this problem happen please follow this step to solve this error:
1. Check your internet connection, make sure it fast enough
2. Fix the date and time with your time zone
3. Open setting and stop imessage
4. Restart your device
5. Start imessage then reactivate again, wait few moments until it’s done
If the problem still persist, try to update you OS to the lastest version available, in many cases this could fix problem with imessage during activation.
For your info, some refurbish iPhone have problem with activation because some parts already changed basically if the internal memory changed with other device. So please check it carefully.