Don't think it is strictly illegal, nor even successfully actionable; it is a defence to an action for libel that the statement was issued with 'justification' viz. true.It is also a defence to say that the statement was issued as fair comment, which defence is generally used instead of justification (seemingly illogical, but who said lawyers were always logical ? It's because a fair comment may cover a statement which is not privably true in every particular)
But, professionally, it is extremely unwise and contrary to good practice.