Skip to main content

[archive] Outlook/Outlook Express

  • August 17, 2007
  • 6 replies
  • 0 views

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.

6 replies

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
The code example utilizing MSMAPI32.ocx will work for both Outlook and Outlook Express. However, you will have to do quite some fine tuning, local configuration that is. There is no such thing as a generic blackbox, local (individual) parameters need to be set up.

As for the smtp error 503, mind you that you will receive this with Outlook Express too, this error has nothing to do with how you send an email, but with what you send an email. Yahoo is notoriously listed as spam source, thus most professional email servers they refuse mail from them.

I suppose you are connected to internet through a internet provider? That provider usually also host a smtp server. Use that one and I am confident your mail goes through. Yahoo are so big they can choose to be ignorant about their mail service, but your local ISP probably not, so they will certainly enforce a strict spam policy to avoid being blacklisted.

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
First, thank you very much for your response.

Do you have an updated copy of the sample program for the MSMAPI32.ocx example?

I'm not following you on the 503 issue...is this something for me to anticipate or are you speaking to another poster's issue/question?

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
As for the 503, it is a common error message if you try to send using an stmp server that is not of the same domain as you. Say you connected to isp.acme.com, but you use smtp.mailanywhere.com. You would either be bounced or have to log on to smtp.mailanywhere.com. If you try to use smtp.acme.com instead, chances are you are all set.

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
Do you have an updated copy of the sample program for the MSMAPI32.ocx example?


Here is the code, you have to use AxDefGen to generate adequate .def files in addition.


       IDENTIFICATION  DIVISION.
       PROGRAM-ID.     OLEMAPI.
       ENVIRONMENT DIVISION.
       SPECIAL-NAMES.
           COPY "MSMAPI32.DEF".
           .

      *When you use this program, it is very important to be aware of the
      *following:
      *
      * Implementation differs slightly depending on whether you use
      * Microsoft Outlook or Outlook Express.
      *
      * If you are using a smtp account configured in your email client,
      * be aware that the email clients default account for sending emails
      * MUST be within the right domain.
      *
      * This means, if you are uncertain whether Outlook Express or Microsoft
      * Outlook is your default email client, you are likely to run into issues,
      * in such a case, test both variants.
      *
      * If you have your smtp set up to use smtp.mydomain.com and you have a
      * laptop, thus right now you connect to the internet using another
      * domain than your normal local network at work, your smtp.mydomain.com
      * will accept any emails from you. Thus, neither will this demo.
      * To address this, create an additional mail account using the default
      * smtp of your otherdomain.com and set that account as default and it
      * should work.

       WORKING-STORAGE SECTION.
       77  MYSESSID                 PIC X(4) COMP-N.
       77  CNTL-FONT                USAGE HANDLE OF FONT SMALL-FONT.
       SCREEN SECTION.
       01 MyMapi.
    03      MYSESSION        MAPISESSION
                   LINE             01
                   COL              01
                   SIZE             03
                   LINES            03.
    03      MYMESSAGE        MAPIMESSAGES
                   LINE             05
                   COL              01
                   SIZE             03
                   LINES            03.
       PROCEDURE   DIVISION.
       MAIN-LOGIC.
           DISPLAY STANDARD         GRAPHICAL WINDOW
                   LINES            16
                   SIZE             30
                   BACKGROUND-LOW
                   CONTROL          FONT IS CNTL-FONT
                   CELL             HEIGHT 12
                   CELL             WIDTH  12
                   TITLE
                   "Microsoft OLE MAPI demonstration".
           DISPLAY MyMapi.
           MODIFY  MySession       
                   DownloadMail     = 0
                   SignOn().
           INQUIRE MySession        SessionID IN MySessID.
           MODIFY  MyMessage        SessionID = MySessID.
           MODIFY  MyMessage        Compose().
           MODIFY  MyMessage
                   MsgSubject       = "Subject hello"
                   MsgNoteText      = "Bodytext hello"
      * If attachment, add full path here             
      *             AttachmentPathName   = "c:\\attach.txt"
           RecipType        = mapToList

      *TO address
      *If Outlook Express:
                  RecipAddress     = [EMAIL="gbush@whitehouse.gov"]gbush@whitehouse.gov[/EMAIL]
      *If Microsoft Outlook:
      *             RecipAddress     = "SMTP:gbush@whitehouse.gov"     
      *             RecipDisplayName = "George Bush"

      *msgType property, Messagetype:
      *If Microsoft Outlook Exchange is your default mail client, MsgType for
      * should not be set!
      *If Outlook Express is your default mail client, MsgType for TO should be
      * set to "IPM.Note"
                   MsgType          = "IPM.Note".

           MODIFY  MyMessage        @Send(0).
           MODIFY  MySession        SignOff().
           DISPLAY MESSAGE BOX "Done." ICON 1.
           DESTROY MyMapi.
       MAIN-LOGIC-END.
           STOP    RUN.

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
Here is the code, you have to use AxDefGen to generate adequate .def files in addition.


When using the AxDefGen utility what source library will I select to generate the .def file?

Thanks again!

[Migrated content. Thread originally posted on 16 August 2007]

Will the code examples that utilize the OUTLOOK COM object work for both Outlook and Outlook Express? If not, what would be the most straight forward approach to providing an email solution to clients who may use both OUTLOOK and OUTLOOK EXPRESS?

Absolutely every opinion will be greatly appreciated!
Thank you.
On the components tab, scroll down until you find:

Microsoft MAPI Messages Control, version 6.0


Note that the version number may vary, it is my experience that which version is not so important.

Also note that when you select the one above, you also get the MAPI Session control automatically.