Hi All,
VC++, Visual Studio 2019
I am facing issues in accessing attachment counts, Here is the code flow:
LPMAPITABLE pATbl = NULL;
LPSRowSet pRow = NULL;
static SizedSPropTagArray(NUM_COLS, sptCols) = { NUM_COLS, PR_ENTRYID,
PR_MESSAGE_FLAGS,
PR_CREATION_TIME,
PR_SUBJECT };
enum { AttNum, AttType, AttFilename, NUM_ATT_COLS };
static SizedSPropTagArray(NUM_ATT_COLS, sptNum) = { NUM_ATT_COLS,
PR_ATTACH_NUM,
PR_ATTACH_METHOD,
PR_ATTACH_LONG_FILENAME };
hr = pMessage->GetAttachmentTable(0, &pATbl);
hr = HrQueryAllRows(pATbl, (LPSPropTagArray)&sptNum,
NULL, NULL, 0, &pRow);
This above code is just to mentions the API used.
in case if my mail has 1 attachment, pRow->cRows value is 1.
when I try to access the attachment name it gives the correct attachment name. (success Scenario)
But in case if the mail has 1 attachment and it is digitally signed also, then also pRow->cRows value is 1. And when I try to access the attachment name it gives the incorrect attachment name(smime.p7m). (this smime.p7m is the attachment file name of the digital signature which gets added automatically)
Query: in case of digitally signed mail, why it is not showing 2 attachments? and How can I avoid this digital signature file programmatically.
Kindly guide or suggest me, I am stuck.
Thanks in advance.