Have you tried using the API, just write directly to the API directory. Dont forget to output the header file last, as it can cause problems if the API Engine picks up the header prior to you writing the body and attachments This link gives sample header, message & attachment files http://www.novell.com/documentation/lg/gw55/index.html?gw55api/data/a2dsckn.html