
Originally Posted by
vermarajeev
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:
QString base64encoded;
// your encoded data here while(base64encoded.length()>64){
slist << base64encoded.left(64);
base64encoded.remove(0, 64);
}
slist << base64encoded; // remainder
QString result
= slist.
join("\x0a\x0C");
// \r\n
QString base64encoded; // your encoded data here
QStringList slist;
while(base64encoded.length()>64){
slist << base64encoded.left(64);
base64encoded.remove(0, 64);
}
slist << base64encoded; // remainder
QString result = slist.join("\x0a\x0C"); // \r\n
To copy to clipboard, switch view to plain text mode

Originally Posted by
vermarajeev
while receiving
1) parse -- How to do this ?
2) contcatenate lines -- How to do this ?
3) base64 decode into ByteArray -- I can do it
4) decrypt ---- I can do it
5) pass the result into the stream -- I can do it
1) parse -- How to do this ?
2) contcatenate lines -- How to do this ?
3) base64 decode into ByteArray -- I can do it
4) decrypt ---- I can do it
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.
Bookmarks