eml已经解析了一大部分了,现在附件的文件名也已经get到了,就差如何保存附件文件,现在我贴出获取附件名的代码,求高手指导。
IBodyParts* pAttachments;
IBodyPart* pAttach;
BSTR pAttachName;
imsgptr->get_Attachments(&pAttachments);//获得附件文件名
long numAttachments;
pAttachments->get_Count(&numAttachments);
for( long i = 1; i <= numAttachments; i++ )
{
pAttachments->get_Item(i, &pAttach);
pAttach->get_FileName(&pAttachName);
_bstr_t bAttachments(pAttachName);
printf("Attachment:%s\n", WcharToChar(bAttachments));
}