in reply to losing spaces in text line

There is nothing inherent in SMTP that does this, so you will have to provide more info.

What does your open line look like, what builds $requests, what mods are you importing/using? Things like that will make this much more solvable.