calibre has a command line interface:
http://manual.calibre-ebook.com/cli/ebook-convert.html
http://manual.calibre-ebook.com/cli/calibre-smtp.html
A calibre-free approach might be to:
- get Send To Kindle app and kindlegen from Amazon
- write a script to feed epub to kindlegen, producing mobi
- script opens Send To Kindle and feeds it the mobi
- check title and author manually (they're often not correct or otherwise ugly) and click Send
On a mac you could set up a watch folder to trigger this script (or the equivalent calibre CLI script) when you drag or copy a file into the watch folder. For windows and linux there are tools for setting up watch folders.