>POST http://xyz/WebContent/Services/EmailAttachment.xsjs 500 (Internal Server Error) sap-ui-core.js:27
That just tells you there was an error on the server side in the XSJS. Look at the body of the response of that call to find more details on the error. Make sure that you have Developer Mode turned on for XS so that it returns detailed error messages.