Smtp output subject

Finishing up #591 
- Merge with dev
- Fix message corruption