SPSS is a Statistical Package, while as t test and z test can be done through all the software .The only thing is that how much comfortable you are with a particular software .
Z-tests are statistical calculations that can be used to compare population means to a sample's. T-tests are calculations used to test a hypothesis, but they are most useful when we need to determine if there is a statistically significant difference between two independent sample groups.
As the colleagues have mentioned, SPSS is just a package. T-test is a test to assess whether the mean of a population is equal to a quantity (or a mean of another population). If the number of samples exceeds 30/40/50 or the distribution of the population under study is normal, we are allowed to apply Z-test instead.