Quote Originally Posted by vermarajeev View Post
I'm unable to understand these points
3. divide it into blocks 64 (or 80 or whatever) bytes each ---- need some more explanation
4. concatenate blocks using newlines (\r\n) ----- ---- need some more explanation
5. pass the result into the mail stream adding a base64 header --------- ---- need some more explanations
If possible please correct me with my code above and tell me how can I achieve the above three points
Ad 3. and 4. base64 encoded data is a string of characters. The usual thing to do is to divide the long line into shorter lines.
Ad 5. Make the result part of your outgoing mail embedding it into proper attachment headers.

Something like:
Qt Code:
  1. QString base64encoded; // your encoded data here
  2. while(base64encoded.length()>64){
  3. slist << base64encoded.left(64);
  4. base64encoded.remove(0, 64);
  5. }
  6. slist << base64encoded; // remainder
  7.  
  8. QString result = slist.join("\x0a\x0C"); // \r\n
To copy to clipboard, switch view to plain text mode 

Quote Originally Posted by vermarajeev View Post
while receiving
Qt Code:
  1. 1) parse -- How to do this ?
  2. 2) contcatenate lines -- How to do this ?
  3. 3) base64 decode into ByteArray -- I can do it
  4. 4) decrypt ---- I can do it
  5. 5) pass the result into the stream -- I can do it
To copy to clipboard, switch view to plain text mode 
Oh come on... I'm not going to write a mail client for you Use your head - think.