Dry out GetTor's sendmail function

This patch refactors the sendmail function in GetTor to avoid code duplication.

https://gitlab.torproject.org/torproject/anti-censorship/gettor-project/gettor/-/merge_requests/6

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information