Encode message before sending it to sendmail

In python3, communication with process must be in bytes, but message
is a string here. So we can force encode the message here.

In Python2, the result is still a string, in Python3 we have bytes
that we can pass to subprocess.