Let $a=\exp (2\pi i u) $ where $0<u<1$. Then it can be proved using Liouville's theorem that $$f(z, a) =\frac{1}{z}+\sum_{n=1}^{\infty}\left(\frac{a^{n}} {z+n} +\frac{a^{-n}} {z-n}\right)=2\pi i\cdot\frac{a^{-z}} {1-\exp(-2\pi iz)}, z\neq 0$$
Is there any other way to prove this preferably using some general techniques for summation of a series?
For $a=1$ it is easy to see that $f(z, a) =\pi\cot\pi z$ (based on infinite product of $\sin\pi z$) and I am expecting some similar approach which works for $a\neq 1$.
Note: For the uninitiated the above identity is crucial to the proof of Kronecker's second limit formula. Apart from this step the formula involves nothing but simple algebraic manipulation and is thus at the same level as the above identity. My interest in Kronecker's formula ignited due to this question.