Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to read Internet header of and email in outlook
Forum Updated to NodeBB v4.3 + New Features

How to read Internet header of and email in outlook

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.5k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AmrCoder
    wrote on 11 Mar 2017, 18:33 last edited by
    #1

    I try to read an email Internet headers that we can view it in email properties in outlook app
    I ask if there is an option so I can get this I use this code to read the emails in outlook

      Outlook::Application outlook;
      if (!outlook.isNull())
      {
      Outlook::NameSpace session(outlook.Session());
      session.Logon();
      Outlook::MAPIFolder *folder = session.GetDefaultFolder(Outlook::olFolderInbox);
    
      Outlook::Items* mails = new Outlook::Items(folder->Items());
      mails->Sort("ReceivedTime");
      int num = mails->Count();
      ui->label->setText(QString("I have %1 of messages").arg(QString::number(num)));
    
      // Indexing starts from 1
      for (int i = 1; i < num; i++)
      {
      Outlook::MailItem mail(mails->Item(i));
      QString s = mail.Subject(); // do something with subject
      QString b = mail.Body(); // do something with body
      ui->plainTextEdit->appendPlainText("subject : \n" + s);
      ui->plainTextEdit->appendPlainText("Body : " + b);
      ui->plainTextEdit->appendPlainText("-----------------------------------------------");
      }
      }
    

    and I was check the Outlook::MailItem for a function to get this Internet header but I not found so if any one try it before or have any idea to solve this
    Thanks in advance

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 11 Mar 2017, 22:50 last edited by
      #2

      Hi,

      What is that Outlook class/Namespace ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      ? 1 Reply Last reply 12 Mar 2017, 09:04
      0
      • ? Offline
        ? Offline
        A Former User
        wrote on 12 Mar 2017, 07:22 last edited by
        #3

        Hi!
        This guy seems to have a solution: http://www.lessanvaezi.com/email-headers-from-outlook-mailitem/. Otherwise, see Outlook MAPI Reference.

        1 Reply Last reply
        2
        • A Offline
          A Offline
          AmrCoder
          wrote on 12 Mar 2017, 09:01 last edited by
          #4

          I use this to include the library it should work with visual c++ compiler

          #include "MSOUTL.h"
          
          1 Reply Last reply
          0
          • S SGaist
            11 Mar 2017, 22:50

            Hi,

            What is that Outlook class/Namespace ?

            ? Offline
            ? Offline
            A Former User
            wrote on 12 Mar 2017, 09:04 last edited by
            #5

            @SGaist It's based on this: http://doc.qt.io/qt-5/activeqt-activeqt-qutlook-example.html, http://katecpp.github.io/outlook-with-cpp/.

            1 Reply Last reply
            2
            • S Offline
              S Offline
              SGaist
              Lifetime Qt Champion
              wrote on 12 Mar 2017, 20:23 last edited by
              #6

              @Wieland Thanks for the link

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0

              6/6

              12 Mar 2017, 20:23

              • Login

              • Login or register to search.
              6 out of 6
              • First post
                6/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved