I have tried to fix this before but couldnt get it working so I am trying again because it would be a very useful feature to have.
I have Settings → Voicemail Admin → Settings → Email Config → Server email → Set this to a gmail email, and a office365 one, neither works. Does it need my password for either of those emails?
Yes, you need a password. Freepbx doesn’t suppor OAuth2 so you’ll need to create an app password in gmail or office365. It’s under Admin>Sysadmin>Email setup. If you don’t have the sysadmin module I understand it’s a bit more complicated to setup email.