Daniel said:
Well, email attachments are encoded using Base64, which
Convert.ToBase64String() and convert.FromBase64String() can handle
for you.
Bear in mind that these routines are not particularly efficient (they
make lots of unnecessary allocations) and they do not provide a facility
to add a newline at character position 76 as per the RFC. This means
that if you want to add newlines you have to make yet more allocations
as you copy sections of the base64 encoded string to another string.
I have written a series of classes that implements base64, yenc and uu
encoding as stream objects with minimal buffering so they are far more
efficient and they have more options than the built in .NET routines.
Email me if you want me to post them on my site.
Richard