This is the soure for varmail.me, a free service I run that allows you to create API endpoints and POST to them to email yourself.
This code isn't likely to be useful to anyone, but you can run your own version by setting up an account with Mailgun and deploying the repo to Dokku.