Dear should I tell him he's bordering on harassment?
Not really, because there is no crime as attempted harassment.
If your lawyer wants to send the landlord and cease and desist letter that may be appropriate. Otherwise, were the landlord's communications not directed to you in order to collect the rent, the landlord may be guilty of the crime of aggravated harassment in the second degree (harassment by electronic communication.)
Unless your lease allowed the landlord to dip into your security deposit the landlord cannot legally appropriate your security deposit to current unpaid rent.
When you do not pay the rent on time the landlord is allowed by New York law to demand the rent from you either by an oral demand or by a written demand. The written demand is required to offer an option to you: Pay the rent within three days (thus known as a three day notice) or in the alternative, move out and give the property back to the landlord. The written demand must alert you that if you do not pay and you do not quit and surrender, the landlord will be allowed to start a nonpayment summary proceeding and request that the court enter a judgment against you.
So your landlord was informing you of the difference between texting a request to pay or serving you with a three day notice. If you pay, no three day notice. If you do not pay, the landlord will prepare the three day notice on his own or with a lawyer and once served on you, your choices narrow down to paying the rent, moving out or doing nothing and allow the landlord to start the eviction case.
The answer provided to you is in the nature of general information. The general proposition being that you should try to avoid a bad outcome if you can.
The statute that might apply is Aggravated Harassment in the Second Degree. However, it requires ththat the landlord intend to "harass, annoy, threaten or alarm another." In your case, I think his intent is to get paid his rent money. You can ask him to stop texting you. I don't know if the police would arrest him if he didn't stop. I don't think his text let you out of your lease.
I am a former federal and State prosecutor and now handle criminal defense and personal injury/civil rights cases. Feel free to check out my web site and contact me at (212) 577-9797 or via email at Eric@RothsteinLawNY.com. I was named to the Super Lawyers list as one of the top attorneys in New York for 2012. No more than 5 percent of the lawyers in the state are selected by Super Lawyers. The above answer is for informational purposes only and not meant as legal advice.