BANGKOK — A retired truck driver was sentenced to 20 years in prison on Wednesday for sending cellphone text messages that a court deemed insulting to Thailand’s monarchy.

The conviction is the latest in a growing number of cases in Thailand under a law imposing harsh penalties for making insults or threats directed at King Bhumibol Adulyadej, 83, and his family, even in private communications.

The defendant, Ampon Tangnoppakul, 61, was sentenced to five years in prison for each message, according to one of his lawyers, Poonsuk Poonsukcharoen, who said his client denied sending any messages.

“He insists that he does not know how to send text messages,” Ms. Poonsuk said by telephone. “He insists that he loves His Majesty the King.”