当前位置: 首页>>代码示例>>C++>>正文


C++ MessagePtr::Send方法代码示例

本文整理汇总了C++中MessagePtr::Send方法的典型用法代码示例。如果您正苦于以下问题:C++ MessagePtr::Send方法的具体用法?C++ MessagePtr::Send怎么用?C++ MessagePtr::Send使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MessagePtr的用法示例。

在下文中一共展示了MessagePtr::Send方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: main

void main()
{
    try {

#if OFFICEXP
        _SessionPtr pSession("MAPI.Session");
#else
        SessionPtr pSession("MAPI.Session");
#endif

        //To DO
        #pragma message ("TO DO: Place profile name at line 87")
        pSession->Logon("Default Outlook Profile");

        FolderPtr   pFolder = pSession->Outbox;
        MessagesPtr pMessages = pFolder->Messages;
        MessagePtr  pMessage = pMessages->Add();

        pMessage->Subject = "VCCOM: MAPI Example";
        //To DO
        #pragma message ("TO DO: Change the absolute path to commsg.txt, line 96.  MUST DO.")
        AddFileToMessage(pMessage, _T("C:\\v7.sd\\samples\\C++\\Compiler TypeLibrary Support\\commail\\commsg.txt"));

        AttachmentsPtr pAttachments = pMessage->Attachments;
        //To DO
        #pragma message ("TO DO: Change the absolute path to this sample code, line 101.  MUST DO.")
        pAttachments->Add("Mapi example source code.txt", 15000L, (long) mapiFileData, "C:\\v7.sd\\samples\\C++\\Compiler TypeLibrary Support\\commail\\commail.cpp"); 
        
        RecipientsPtr pRecipients = pMessage->Recipients;
        RecipientPtr pRecipient = pRecipients->Add();
        //To DO
        #pragma message ("TO DO: Change the recipient name appropriately, line 107.  MUST DO.")
        pRecipient->Name = "paulring";
        pRecipient->Type = (long) mapiTo;
        bstr_t bstrName = pRecipient->Name;
        pRecipient->Resolve();

        pMessage->Send(false, false);
        pSession->Logoff();
        _tprintf(_T("Successfully sent message to %s.\n"), (LPCTSTR) bstrName );

    } 
	catch (_com_error &e) {
        dump_com_error(e);
    }
}
开发者ID:Jinjiego,项目名称:VCSamples,代码行数:46,代码来源:commail.cpp



注:本文中的MessagePtr::Send方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。