Skip to Content
author's profile photo Former Member
Former Member

Sending emails using OLE

PB 12.1 and 12.5

Outlook 2007/2010

Win XP and 7

Having issues sending emails automatically from application. Code developed in the 90's no longer works. MSDN documentation seems to indicate it should so I'm guessing I'm doing something wrong in Powerbuilder.

Basically the mailitem.Display and mailitem.Send functions trigger a runtime exception saying unable to access.

I've replaced mailitem.Display to...

inspector.mailitem.GetInpector

inspector.Activate

It works great.

I cannot find a Send alternative. Anyone familiar with this? I know my target audience is limited so please respond only if your familiar with OLE and Outlook interop.

Thanks

ole.txt.zip (826 B)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

4 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Sep 20, 2013 at 10:00 PM

    You should try using SMTP instead. It bypasses Outlook, your app will communicate directly with your mail server.

    http://www.topwizprogramming.com/freecode_emailsmtp.html

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Former Member

      Hi Roland;

      Yes, I know. Your "add-on" code is great! 😎

      I was talking about PB natively supporting ExtendedMAPI and SMTP. These features have been asked for many times in the past - but, Sybase just kept ignoring the PB community's enhancement requests.

      Regards ... Chris

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2013 at 02:14 PM

    Hi,

    I tested your code and just added ole_item.Send() and it works for me.

    HTH.

    Abdallah.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Sep 23, 2013 at 03:17 PM

    In addition to what Roland suggested, I have a utility that does SMTP via PBNI:

    https://pbnismtp.codeplex.com/

    As well as a sample of doing it through .Net (look for SMPTClient.zip).

    http://goo.gl/VXouQ

    You can use SMTP to send mail through the exchange server that Outlook talks to.

    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member Bruce Armstrong

      I have a comprehensive package developed that performs various tasks and calls utl_mail to send messages. For my site which will not turn on Oracle mail due to regulations I put a stub out there and return the PII back to the client for sending the mail. Eventually they will realize that there "security" requirement is actually less secure and require an encrypted database connection. That is just one of my OAS motivations from the other thread.

  • author's profile photo Former Member
    Former Member
    Posted on Sep 23, 2013 at 06:05 PM

    Thanks to all for the input. Based on the information and testing my conclusion is as follows:

    Powerbuilder now has limited mail integration capabilities using Outlook 2007 and higher. Code that works accessing Outlook 2003 on XP now fails in Outlook 2007 and higher on XP/7. This is due to security enhancements made by Microsoft and Sybase has not updated its methods to maintain a native interface.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.