The formula for the volume \( V \) of a rectangular pyramid is given by:
\[ V = \frac{1}{3} \times \text{Base Area} \times \text{Height} \]
In this case, the base is a rectangle with a length of 8 mm and a width of 5 mm.
First, we calculate the area of the base:
\[ \text{Base Area} = \text{Length} \times \text{Width} = 8 , \text{mm} \times 5 , \text{mm} = 40 , \text{mm}^2 \]
Next, we know the height of the pyramid is 18 mm. Now we can plug the area and height into the volume formula:
\[ V = \frac{1}{3} \times 40 , \text{mm}^2 \times 18 , \text{mm} \]
Calculating that gives:
\[ V = \frac{1}{3} \times 720 , \text{mm}^3 = 240 , \text{mm}^3 \]
Thus, the volume of the rectangular pyramid is
\[\boxed{240} , \text{mm}^3\]