Sexting is an interesting topic, because it's not always a crime. Two adults who are willing may send each other nude images or sexual images without facing any kind of penalties. There is a line that is sometimes crossed, though.
There are times when sexting can get you into trouble with the law. When sexting goes to court, it's usually because of a person sending illicit images to a child or because of sending images to someone who feels harassed or threatened by them. Generally speaking, sending photos of your genitals or sending nude photos to another person against their wishes can be considered sexual harassment.
What happens if a minor sends illicit images to another person willingly? Another interesting issue with sexting comes up when minors are involved. Technically speaking, anyone under the age of 18 who sends a photo of him or herself nude or exposed to another person is creating and sending child pornography. Those over the age of 18 cannot send or solicit images from those under 18. Although it's been argued in the past that those under the age of 18 shouldn't be held accountable if they're sending images to other minors, others take a hard line approach and believe anyone committing a crime of this nature should face punishment.
What kinds of penalties can people face? Those who violate sexting laws, harass others or create, send or receive child pornography may end up having to register on a sex offender registry. They could be sent to prison or face heavy fines and penalties.
Source: FindLaw, "Sexting," accessed March 03, 2017