This can be done by clicking the "Code" button that is above the message composing box, or by manually typing the "code tags" around the code.
In the message edit window, code tags look like this:
- Code: Select all
[code]... code goes here ...[/code]
To copy a large block of code that is enclosed in code tags you can click on the "SELECT ALL" link at the top of the code box, then copy.
Note for Firefox users (and may also affect other web browsers):
When copying, Firefox adds an additional "Tab" character to the start of each line.
To prevent this from happening, there are Firefox plug-ins available that copy as plain text. (I am currently using the Add-on "Copy Plain Text 2 1.3.2" which is working well).