OE New Message with Attachment from MIME


Desktop-as-a-Service Designed for Any Cloud ? Nutanix Frame

Environment: Visual C++

This program is very useful when you want to send a message with an attachment if you use Outlook Express like your default program for sending or receiving messages. It is also useful in case of sending your documents from database, because it writes your attachment and puts it in a message.

In the EMail dialog there is the edit multiline control where you can type the text of the attachment. On the Email button you can save this text like a *.txt file and that text file is to be the attachment.

This function is similar to the function CDocument::OnFileSendMail(), except that using my function you may also put a subject and a note text in a message. In general, you can fill the MapiMessage structure as you like.

MapiMessage message;
memset(&message, 0, sizeof(message));
message.nFileCount = 1;
message.lpFiles = &fileDesc;
          "This program send message with *.txt attachment";


Download demo project - 70 Kb


  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date