I guess you're running out of memory. There are two problems in the sketch: You're not using the F() macro for constant strings in the print() and println() methods and you're using the String class which clutters up the available memory and should not be used on microcontroller systems as the Arduino with only 2kB of RAM.
So first replace all calls of type
client.print("Any constant string here");
to
client.print(F("Any constant string here"));
If that doesn't help, replace all occurrences of String with conceptional identical functions using C-strings (char *) as there are sprintf() and the like.