How can I share my wordpress site with a friend?

Is the mail configured for your server?

If not or isn’t possible, try using an SMTP mail plugin and connect to example gmail, by letting less secure apps use it. You’ll have to configure it in the plugin and on the gmail account also.

But yes, if your server isn’t on the same network as your friends computer, you need a remote/shared server.