To keep things simple, I have stripped out the rest of the code and limited it to the main function, which is to send an SMS message on a click event, via a server that has been set up.
Error message is object required. This happens, of course, at the Set declaration. It's late, I'm tired...