You’re getting all of Ted’s underhanded tricks mixed up. It’s OK, it’s understandable.
Trump said when Cruz lied about Carson on caucus day, it should have been illegal and Cruz should have been punished.
To my knowledge, Trump never said the shame mailers were illegal, just underhanded voter intimidation.
Those “social media” mailers have been used by campaigns in many states for at least a decade.