smtp attachment

I don’t know how to configure the smtp attachment/content object so that I can send a csv file as an attachment. I can send emails okay, however, sending an attachment has failed. I include the attachment/filename, attachment/contenttype is application/vnd.ms-excel and I leave attachment/content empty. Should I have something mapped to the attachment/content?

Iranell,

You can use pub.string:stringTobytes and then map the bytes to attachment/content, set content-type = “application/x-wmflatfile”

BTW make sure your ffstring is a comma seperated string (csv) file??

HTH,
RMG

Here is where I am confused, what am I putting in pub.string:stringTobytes since the file already exists on the server.

Iranell,

fyi…

With using pub.client:smtp service it cannot not pickup the physical file from the filesystem basically you have to map to its param attachment/Content and the param you set the attachment/filename(for example:sample.csv) will be assigned to the attachment/Content(bytes) that you are mapping above.Then in the email attachment you will get attachment named sample.csv file.

You got to have the file in the pipeline,so load the file and then send it as attachment.Try this flow:

pub.file:getFile (loadAs bytes or stream to compress)
pub.client:smtp (map bytes or stream to attachment/Content,set content-type= application/x-wmflatfile or application/vnd.ms-excel)

Test the above flow.

HTH,
RMG

Thanks for clearing that up. Would I need to do anything different if it were a zip file?

Yes could be handling binary or streams…Pls check into the WmSamples package there are zip/unzip related services out there you may review it.

HTH,
RMG