Skip to Content

PowerBuilder’s only native method of sending email is through Simple MAPI, which is very limited.  In particular, the approach was hampered quite a bit when Microsoft introduced security enhancements which resulted in security warnings being generated anytime Simple MAPI was used.

The most popular approach for addressing this has been to use SMTP to send email instead.  There are quite a number of third party tools that can be used to accomplish this:

  • Topwiz Software’s EmailSMTP is a PowerBuilder non-visual user object that uses Windows API calls to send SMTP.
  • This blog post explains how to create a .Net assembly that can then be wrapped via a COM Callable Wrapper and called from Classic PowerBuilder.  The blog article uses Visual Studio and C# to create the assembly, but the assembly could also be created using PowerBuilder.Net.  The STMPClient.zip file in these PowerBuilder Samples on Google Drive is an example of doing just that.
To report this post you need to login first.

6 Comments

You must be Logged on to comment or reply to a post.

  1. russell fleming

    Bruce,

    Always respect your knowledge and insights. For this topic your within the context of a controlled corporate environment? I mean you would not send emails directly accessing a customer’s server if your software was sold commercially.

    (0) 
    1. Bruce Armstrong Post author

      I don’t see the issue.  We have one commercial app where we use PBNISMTP.  We give the admin users (employees of the customer) a configuration screen where they enter the email configuration information for their servers.  They’re sending email from the app to their users (mostly reports that we generate into Excel spreadsheets and then email).  Another commercial app uses the database package approach.  We have admin screens (once again used by customer employees) that enter the email configuration information that the app will use to send email to other customer employees).

      (0) 
  2. Jose Puertos

    Hi Bruce,

    I download the Topwiz software EmailSMTP, but when I execute the example I have the next SendMailError message:

    An attempt was made to access a socket in a way forbidden by its acces permissions.

    I have in Settings an internal SMTP relay server with the port 25 and not require user an password.

    What I’m doing wrong?Settings.gif

    (0) 

Comments are closed.