Via TidBITS, never known it is such a long list of things to do
Bring up the text message in Messages and be sure not to click any URLs embedded in the message.
Tap the empty circular (radio-style) button to the left of the unwanted message. The Forward button activates.
Tap the Forward button.
Enter 7726 (the numeric equivalent of the letters SPAM on a telephone keypad) and tap Send.
AT&T responds with a message asking you to send the number from which the message originated.
You can write down the number of the spam and then tap it in, but you can also use my uncle’s trick here too. Back at the spam message, tap Add Contact > Create New Contact, and either make that “Sir Spam-a-Lot” entry or tap Add to Existing Contact if you already have one. (If this number is already in an entry, tap Contact.)
Now tap the number that was added (or is already there in the Edit screen), tap Select All, and tap Copy.
Tap Done to close the Contact view.
Navigate back to the message you received from AT&T, tap in the Text Message field, tap Paste, and tap Send.
You will receive a response from AT&T that they “appreciate your assistance.”