How can you be GDPR compliant then? (Customers's email address are personal information and must be deleted after 3 years of them stopping to do business with you, and that includes purging the emails you got from them or sent to them).
Incorrect.
The GDPR dose not specify three years.
The right to erasure does not apply when it is conflicting with member state law that requires data to not be deleted.
See https://gdpr-info.eu/art-17-gdpr/, 3.b.
So the the GDPR erasure right is not an universal right in its own, it defines a framework that you are expected to defer to when there are no statutory requirements otherwise.