Since this is a legal issue, it is very smart to consult a legal counselor, Paying him 1 hour work advise will save you a lot of money.
Now, to reply how I see this, in case you want to risk your money.
If you are a company or a registered individual, and the client comes to your business and you implement illegal app, you are legally responsible.
If you are his full-time employee and among other tasks he gives you a task to create such software, then you are not legally responsible.
Now you probably know it's smart to stay away from such project. If you really want it since the money is good, then get a contract where the project will look like a legal thing (collecting emails can be legally used in statistics as well) and put the clause where you are not reliable if the client uses the product for illegal matters. Then it's his responsibility to use it legally or not.
But to repeat again, get a professional advise in written from the legal counsel. This money will be well spent money.