I am new to the world of Web Email and domain hosting. I was looking into projects like https://temp-mail.org/en/ and https://kopeechka.store. In these applications I can receive an email address, receive emails to those email addresses, and then delete the email from a simple python client using API calls to their API's. I want to replicate something similar using my own domain name(I have not registered one yet) and email server. I was looking into possible email hosting providers that have there own API but I have not found a cheap option. I am also open to creating my own email server using a vps but I do not know how I would turn a vps into a mail server on my own domain name and be able to make api calls from a simple python or JavaScript client that could create a new email address, receive emails from that address and delete the email address and mailbox.
Some examples of these API calls being made in python using requests might look like
Create a new address
import requests
import json
url = "https://api.Mydomain.com/email/addresses/Create-new-email"
payload = {
'Login': "New-address-username"
'Password': "New-address-password"
}
headers = {
'authorization': "Example-API-KEY",
'content-type': "application/json"
}
response = requests.request("POST", url, data=payload, headers=headers)
print(response.text)
Program would print
Created Address [email protected]
A similar method of API calls could be used to list all the emails the address has received and retrieve the contents of a specific email, as well as delete an address and all the associated directory's and emails.
Any information on how I could go about this will be appreciated.