You legally cannot put a note in your neighbors mailbox.
Any mail that goes into a mailbox is legally required to have a postage stamp and go through the USPS for delivery to the mailbox.
But as long as your neighbor knows you're placing a note in their mailbox then it's still illegal, but likely won't get you into trouble.
My neighbor and I sometimes place notes or cards in each others mailboxes and although it's considered illegal by the USPS, we don't get into trouble, because we both know we're doing it and are not gonna report each other to the USPS.
And we remove the notes or cards before the USPS accesses the mailbox for delivery.
But what can get you into trouble is going to peoples mailboxes without their consent and just leaving notes or flyers etc without it having postage.
It would be better to leave the note on your neighbors door or tape a note to the outside of their mailbox and not inside without their permission.