>However i need help on how to make this pdf available in the Server so that i could refer it when sending mail.
Well in your source code example above you are sending it in the body of the request to the server. That seems like the correct way to me. Is that not working for you?
>If the pdf is available in the server, then how will i refer this pdf in xsjs as data (as in the above post)
Also in your code above you seem to already be doing this. You take the PDF content from the body of the request and use that as an attachment. No need to actually store it in the server I guess. My suggestion before was to access it as a byte array and not a string. Is that not working for you?
You seem to already have solutions to your problems in the source code you posted.
>Even to try out whether i am able to attach a dummy image, i placed an image file in a folder where xsjs is available and tried using import statement.
You can't just import just any file. The import only works on XSJSLIB. For anything else you would have to read it from the database or use the repository apis to access the content.