Method of uploading contacts to a new iPhone?
Looking around, it appears there may be an app called Contacts Kit on the Mac app store. If I read correctly, this can be used to export the contacts to a file (which I know you have already done, however your file may be corrupted considering the process crashes) and then you do the steps in mail you did previously.

One thing I may suggest is that you open the App Switcher by double pressing the home button, and swiping upwards on every app but the mail app to close them off and free up memory. Considering your contacts list is in the hundreds of thousands you may simply be running out of memory, as I've had apps crash before when I ran out of memory. This can especially happen if the phone is older (thinking iPhone 5 as it can have as little as 512mb of RAM, yet still run iOS 10).