It seems to me that the module should do some enforcement on its own in case the application using it chooses not to (or screws up in some other way). The send() function already silently truncates the "from" field if it's too long. My idea is that it could also return an error if either the message or the combined message + "from" is too long. (Or it could truncate the message, but I think returning an error is better as it gives more immediate and useful feedback.)
I've already made some experimental changes that will do this, and tested them. If interested, let me know.