Update example to include separate email parameters. Split header folding out into separate function, and added corresponding test cases. Applied the chunk function to base64 attachments. Remove undefined behavior resulting from negative shift.