Attachments persistence

Hi Pippin, 

This is a revised version of the earlier PR. This just deals with making the attachments belong only to the call to send() so they're not accidentally reused. 

The issues with the hardcoded header are still there - unfortunately I've not had time to look at that today, but I think this PR is valid in isolation now.