The above code should not be uploaded to the cloud. The code should be run on your system or on a VPS such as Digital Ocean. It’s a python code. Also you have to update the key, sandbox, recipient with your details from Mailgun so that the email gets sent.
@siddarth.naik : If I am right, you had posted on another thread regarding help that you needed with the UI.
I am guessing that, that’s what you really needed. If that is the case, go to the following thread. I have posted a suggest to solve your problem
If you really want to know how to write, upload and run a python code on the Digital Ocean droplet, you can go through the following project for those details.