Hey there ef1401,
Thanks for reaching out to the Apple Support Communities. Just to clarify, are you needing help with recovering your Gmail account you use as an Apple ID account, or are you unable to add your Gmail account to the Mail app on your new iPhone?
If having issues with resetting your Apple ID password, and you're unable to receive a verification code needed to reset the password, do you by chance have access to any other devices that are still signed into your Apple ID? If so, you can try receiving a verification code from that device with the steps shown here: Get a verification code and sign in with two-factor authentication - Apple Support
Get a code from Settings on your trusted device
If you can’t receive a verification code on your trusted devices automatically, you can get one from Settings, even if your device is offline.
From your iPhone, iPad, or iPod touch
If your device is online:
1. Go to Settings > [your name].
2. Tap Password & Security > Get Verification Code.
If your device is offline:
Go to Settings > [your name].
1. Tap Password & Security.
2. A message says "Account Details Unavailable." Tap Get Verification Code.
From your Mac
1. Go to Apple menu > System Preferences, then click Apple ID.
2. Click Password & Security > Get Verification Code.
If you're still unable to retrieve a verification code, or if you don't have access to another trusted device, the next best option would be to start an account recovery request with the steps in this next resource: How to use account recovery when you can’t reset your Apple ID password - Apple Support
Be sure to look over the information carefully, especially the "After you start account recovery" section, as this provides details that can help with preventing delays or accidental cancellations in the recovery process.
If the issue is not with your Apple ID, and you're unable to add your Gmail account to the Mail app due to a forgotten password, the best option would be to reach out to Google's support at this link here: Gmail Help
We hope that's able to help.
Take care!