ChiefRedBull
09-11-2002, 08:57 AM
Since SMTP email is sent in plain text format and only allows printable text, you can't just put raw binary in there, or else it the mail will be refused transfer, or it may not be transferred correctly, meaning that you lose the attachment. On top of that, no email client will recognise the attachment if it does get through, thus your recipient will have to do a lot of work to get it.
So, as promised, here is my Base64 class. It will encode, decode, span and unspan binary data received in the form of a byte array. As far as I can tell, it goes pretty darned fast, and if it's un-usably slow, then you shouldn't be attaching that much to an email in the first place :)
Included are two classes - CBase64 which does that hard work, and CAttachments to extract, decode and save attachments from emails; plus of course two demo projects, one for each class.
This is just a source code project, no explanations other than the comments, but if you'd like to read more, visit WinsockVB::Base64 (http://www.winsockvb.com/advanced/base64/base641.html)
Bugs via PM please :D
So, as promised, here is my Base64 class. It will encode, decode, span and unspan binary data received in the form of a byte array. As far as I can tell, it goes pretty darned fast, and if it's un-usably slow, then you shouldn't be attaching that much to an email in the first place :)
Included are two classes - CBase64 which does that hard work, and CAttachments to extract, decode and save attachments from emails; plus of course two demo projects, one for each class.
This is just a source code project, no explanations other than the comments, but if you'd like to read more, visit WinsockVB::Base64 (http://www.winsockvb.com/advanced/base64/base641.html)
Bugs via PM please :D