Working version of smtp with file attachments. Aleluya!
Refactored code and working x-smtp headers