Former US Congressman Anthony Weiner was sentenced to 21 months in prison on Monday for sending sexually explicit messages to a 15-year-old girl which set off a scandal that played a role in the 2016 US presidential election.