XPages: Generate CSV file and attach to mail -
i'm trying generate csv file (specifically .ics) , attach email. email composed via ssjs-function. opportunity generate csv file, save document , attach email .
i tried generate csv file via xagent in xpage (like http://www.wissel.net/blog/d6plinks/shwl-8248mt) , handle of output, no success.
do know possibility manage this?
any appreciated!
thanks in advance!
you looking @ 2 tasks:
- create csv / ics file
- send attachment
for #1 can use stringbuilder or printwriter or whatever. ics file not csv file, icalendar format. generate highly recommend ical4j. in case whatever write -> don't create file. use printwriter (for csv) uses bytearrayoutputstream (or directly ics4j), result bytearray in memory.
for #2 1 mental step must make away "the notes way" trying deal embedded objects etc. create mime message (there snippets on openntf) , create mimepart. there can use setcontentfrombytes , have attachment.
pro tip (to make life easier): create java class function takes outputstream parameter generates file you. way can test in eclipse (or domino designer java view) without having run preview , full debugging support (you provide file-output stream testing , write file - or system.out)
Comments
Post a Comment