OE New Message with Attachment from MIME


Application Security Testing: An Integral Part of DevOps

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


  • How can you attach multi-files at Outlook Express?

    Posted by Legacy on 03/17/2003 12:00am

    Originally posted by: Kit

    How can you attach multi-files at Outlook Express?

    Help me!

  • more information about mail ( smtp, imap, pop, mime)

    Posted by Legacy on 03/18/2002 12:00am

    Originally posted by: anna

    a lot of information are available here :


  • E-Mail

    Posted by Legacy on 01/09/2002 12:00am

    Originally posted by: Maya

    If you save *.txt attachment in other and not in current directory, you get error "Send mail failed to send message".
    The bug is in the line :

    if (file.Open(m_strPathName/*m_strTitle*/, CFile::modeReadWrite | CFile::modeCreate, NULL) == 0) {
    str.Format("Can't Write %s File!", m_strPathName);
    AfxMessageBox(str, MB_ICONEXCLAMATION);

    (m_strPathName instead m_strTitle)

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

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

Top White Papers and Webcasts

  • As all sorts of data becomes available for storage, analysis and retrieval - so called 'Big Data' - there are potentially huge benefits, but equally huge challenges...
  • The agile organization needs knowledge to act on, quickly and effectively. Though many organizations are clamouring for "Big Data", not nearly as many know what to do with it...
  • Cloud-based integration solutions can be confusing. Adding to the confusion are the multiple ways IT departments can deliver such integration...

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date
We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.