Click here to Skip to main content
15,891,473 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionProblem with MAPISendMail without outlook running Pin
harishkj11-Jan-09 18:05
harishkj11-Jan-09 18:05 
AnswerRe: Problem with MAPISendMail without outlook running Pin
Stuart Dootson11-Jan-09 23:31
professionalStuart Dootson11-Jan-09 23:31 
AnswerRe: Problem with MAPISendMail without outlook running Pin
Stuart Dootson11-Jan-09 23:34
professionalStuart Dootson11-Jan-09 23:34 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Harish_kj12-Jan-09 1:07
Harish_kj12-Jan-09 1:07 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Harish_kj12-Jan-09 1:32
Harish_kj12-Jan-09 1:32 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Stuart Dootson12-Jan-09 3:57
professionalStuart Dootson12-Jan-09 3:57 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Harish_kj12-Jan-09 17:54
Harish_kj12-Jan-09 17:54 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Stuart Dootson12-Jan-09 21:32
professionalStuart Dootson12-Jan-09 21:32 
The rough procedure is this:


  1. Open a MAPI session with MAPILogonEx and get an IMAPISession interface pointer
  2. Open your message store with IMAPISession::GetMsgStoresTable and then IMAPISession::OpenMsgStore. This gets you an IMsgStore interface pointer.
  3. Open your address book with IMAPISession::OpenAddressBook. This gets you an IAddrBook interface pointer.
  4. Open your outbox with IMsgStore::OpenEntry to get an IMAPIFolder pointer on your Outbox.
  5. Create the new message with IMAPIFolder::CreateMessage. This returns an IMessage interface pointer.
  6. Set the message attributes:

    • IMessage::ModifyRecipients to add recipients
    • The message body is either RTF (complex) or plain text (easy). For plain text, set the PR_BODY_W property of the message
    • Set the 'Sent Items' folder for the message by setting the message's PR_SENTMAIL_ENTRYID property
    • Set the message's subject by setting the PR_SUBJECT_W property
    • Set the message type by setting the PR_MESSAGE_CLASS_W to the correct string (I used "IPM.Note")

  7. Send the message with IMessage::SubmitMessage
  8. Then release all the interface pointers correctly
  9. I wrote wrappers around all the interface pointers to simplify these operations as much as possible - it's still pretty involved, though...

GeneralRe: Problem with MAPISendMail without outlook running Pin
Harish_kj13-Jan-09 2:22
Harish_kj13-Jan-09 2:22 
GeneralRe: Problem with MAPISendMail without outlook running Pin
Stuart Dootson13-Jan-09 21:27
professionalStuart Dootson13-Jan-09 21:27 
GeneralRe: Problem with MAPISendMail without outlook running Pin
bolis30-Nov-10 2:06
bolis30-Nov-10 2:06 
Questionpointer and address ? Pin
dec8211-Jan-09 15:04
dec8211-Jan-09 15:04 
GeneralRe: pointer and address ? Pin
Luc Pattyn11-Jan-09 15:29
sitebuilderLuc Pattyn11-Jan-09 15:29 
GeneralRe: pointer and address ? Pin
Hamid_RT11-Jan-09 19:55
Hamid_RT11-Jan-09 19:55 
GeneralRe: pointer and address ? Pin
Luc Pattyn12-Jan-09 2:12
sitebuilderLuc Pattyn12-Jan-09 2:12 
Question[C] IRC client check if he is still operative Pin
ogn0s11-Jan-09 10:59
ogn0s11-Jan-09 10:59 
AnswerRe: [C] IRC client check if he is still operative Pin
Code-o-mat11-Jan-09 11:47
Code-o-mat11-Jan-09 11:47 
GeneralRe: [C] IRC client check if he is still operative Pin
ogn0s11-Jan-09 13:11
ogn0s11-Jan-09 13:11 
GeneralRe: [C] IRC client check if he is still operative Pin
ogn0s11-Jan-09 13:35
ogn0s11-Jan-09 13:35 
GeneralRe: [C] IRC client check if he is still operative Pin
Code-o-mat11-Jan-09 22:15
Code-o-mat11-Jan-09 22:15 
GeneralRe: [C] IRC client check if he is still operative Pin
ogn0s12-Jan-09 9:05
ogn0s12-Jan-09 9:05 
QuestionCSlider that works backwards Pin
Chris Hills11-Jan-09 10:20
Chris Hills11-Jan-09 10:20 
AnswerRe: CSlider that works backwards Pin
Graham Bradshaw11-Jan-09 11:52
Graham Bradshaw11-Jan-09 11:52 
AnswerRe: CSlider that works backwards Pin
Richard Andrew x6411-Jan-09 12:04
professionalRichard Andrew x6411-Jan-09 12:04 
QuestionTrying to create a File Menu [modified] Pin
BobInNJ11-Jan-09 9:06
BobInNJ11-Jan-09 9:06 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.