If i need to use a backend to send an email... I need a local server?

I’ve a question. I’m using a php library to send emails but i need a local server to make it works.

If i keep the file in my xammp it works, but if i disconnected i’m not able to send emails anymore, then here is my question… Can i create a cloud service who store that file and do an http request to sending emails or i need an specific server?

Can this be achieved using firebase or keep it in my ionic app? i’m quite lost with this

I should store it on my webserver (hosting or dedicated server or cloudvps).
Then you are sure it’s always reachable.

there are any free services who offers this? For example firebase or something?