Problem in attaching PDF's in Email through Gatewayscripts

Please post formatted code, not pictures of code. That way we don't have to type it all out again to test or edit in our answers.