Category: SMTP

How to test SMTP with PowerShell for setting up Maximo email notifications?

In an enterprise IT environment, it is sometimes difficult to set up Maximo to talk with SMTP service due to networking and security restrictions. To troubleshoot SMTP configuration, in the past, we used Telnet from the CMD tool. However, in newer versions of Windows Server, Telnet is often not installed by default. In such cases, we can use PowerShell to test and confirm the SMTP and firewall setting is working before configuring SMTP in Maximo.

The first thing I would do is check whether firewall has been opened so that the port used by SMTP service (e.g. port 25) is reachable from the Maximo server. I’ve provided details on how to do this with PowerShell in this post: Check network firewall status with PowerShell 

Once it is confirmed SMTP service is reachable, the next step I would do is to ensure we can send an email with the provided login details. Thus, from PowerShell running on the Maximo server, I would do the following commands:

Note that if SMTP service doesn’t require authentication, we don’t need to run the first command and use the parameter -Credential $cred in the second command.

Replace placeholder values with actual details required by your SMTP service, and for the -To parameter, enter your email address.

The Send-MailMessage command will send an email using your SMTP
service. If it works, you should receive an email.

Once SMTP service is confirmed working, I’ll go ahead putting the details to System Properties in Maximo and that should be it.

To test that Maximo can send emails, the simplest way I would
do is to open any work order, then use the Select Action > Create >
Communication
, then entering my own email into the “To” address field. If it
works, after clicking on Send, it should show a successful status, and you’ll
receive an email within seconds. Otherwise, you might want to look at
SystemOut.log file to see if there are any details of the error there.

Setup Cognos 11 to send email with Gmail (2020)

When I tried to set up Cognos 11 to send notifications via Gmail, it failed because
Google blocked access from Unsecured App. Even if I tried to turn off this option
and tried again, it still failed because Google automatically turned this setting
off again. So I had to create an App Password for my Gmail account to make it
work by following the steps below:
Step 1: Configure Gmail account
  • Log in to my Gmail account, go to “Manage your Google Account page”, then go to “Security” section
  • Enable 2-Step Verification
  • Once 2-Step Verification is enabled, the App Passwords option will be visible under the 2-Step verification option
 
 

  • Click on “App Passwords” to generate a new one. 
  • On the next page, choose “Mail” app, and “Other (Custom Name)” in the Select Device drop-down
  • On the next page, enter “Cognos” for the name of the app, then click on “GENERATE”
  • On the next page, copy the password, paste it to Notepad, then click on Done
 
 
Step 2: Configure Cognos:
  • Open “IBM Cognos Analytics” > “IBM Cognos Configuration” (not the one with the same name under “Framework Manager”)
  • Open “Notification” on the left side Explorer bar, enter
    the configuration as follows:

    • SMTP Mail Server: smtp.gmail.com:465
    • Account and Password:
      • User ID: <account_name>@gmail.com
      • Password: <Generated app password
        from the previous step>
    • Default Sender: <account_name>@gmail.com
    • SSL Encryption Enabled: True
  • Click Ok. Then Save the setting
  • Right-click “Notification” on the left Explorer menu again, and click on “Test” to check if the connection is working.
  • After the SMTP connection has been tested, to send a report from Cognos via email, we have to restart Cognos service for the change to take effect.