I've replaced that line and it's now working fine, thanks. I don't know why it was wrong though - I copied and pasted the code you gave me into the Universal Email Server Behavior Trigger dialog box so it must have got rewritten somehow.
Thanks again
Margaret