Ajesh
1st November 2018, 20:21
Hello there

I was just trying out File attachment sent through cmf email feature. I am getting the file attached, but the attachment name is coming as the same as the subject of the Email,


attachment.ID = cmf.createAttachment(message.ID)
ret = cmf.setAttachmentBody(attachment.ID,ttyeno.no)
ret = cmf.setAttachmentMIME(attachment.ID,"text/plain")
ret = cmf.setAttachmentFileName(attachment.ID,filename)


I am using the Microsoft EMail facility.

I am creating the file like, Filetext.txt but the File is coming as <SubjectName>.eml

Any Clues?

Regards
Ajesh

oirfeodent
2nd November 2018, 09:06
Hello there

I was just trying out File attachment sent through cmf email feature. I am getting the file attached, but the attachment name is coming as the same as the subject of the Email,


attachment.ID = cmf.createAttachment(message.ID)
ret = cmf.setAttachmentBody(attachment.ID,ttyeno.no)
ret = cmf.setAttachmentMIME(attachment.ID,"text/plain")
ret = cmf.setAttachmentFileName(attachment.ID,filename)


I am using the Microsoft EMail facility.

I am creating the file like, Filetext.txt but the File is coming as <SubjectName>.eml

Any Clues?

Regards
Ajesh

The help says

function long cmf.setattachmentfilename (long attachment, string filename [, string displayname])


Can you try adding the third parameter?

Regards,

Ajesh
2nd November 2018, 15:48
Tried that.. But no effect. Its coming as same.

NPRao
29th October 2019, 21:56
Ajesh,

Post your complete code for others to help out. It is working for me.
Also refer to the example program -
eMessage Connector examples (http://www.baanboard.com/programmers_manual_baanerp_help_emessage_connector_examples)

ret = cmf.setSubject(message.ID, "Sample CMF Message")
ret = cmf.setAttachmentFileName(attachment.ID,sourcefile, "Sample Attachment")