本文整理汇总了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);
}
}