Here in Europe it would be illegal, due the privacy rules in the GDPR. You don't want to do illegal things, do you?
Those email addresses are maintained by Google (you have to provide an email address to be able to use the Play Store) and Apple (for the App store and iCloud). So you should ask them.
Hi, We have a lot of customer database and while initial collection we couldn't capture the email id's. Since it is cumbersome to call and ask for email id's. Are there any hacks to get the email id's associated with mobile number.