mysterious syntax errors with mail functions