If z is a complex variable
If you asked me that question 25 years ago, it would have been a cinch. All that I recall is that the function has an infinite (in both directions i.e. -inf to inf on the sum, as YOU have. One must apply the Residue Theorem judiciously. I shall try off line ans see if I can put it together. MAYBE, I''l be back!