Thank you for all who contributed to this area of functionality,
Original Message:
Sent: Fri January 20, 2023 10:01 AM
From: Svetlana Pestsova
Subject: Enabling email notification in PAW Local - error sending email
Thank you, Willam!
We'll make sure that the above info is included into the IBM official documentation
and fix the toast message as well.
Best regards,
------------------------------
Svetlana Pestsova
IBM Planning Analytics Product Manager
Original Message:
Sent: Thu January 19, 2023 09:07 PM
From: William Smith
Subject: Enabling email notification in PAW Local - error sending email
Svetlana, this information really needs to go in the official TM1 documentation as a major headline. Currently it's only listed under "2.0.78 - What's new, July 13, 2022" and no where else in https://www.ibm.com/docs/en/planning-analytics/2.0.0
Googling into this forum post after several hours of searching was the only way I found a solution.
The information listed here appears to be irrelevant for PAW local e-mail configuration: https://www.ibm.com/docs/en/planning-analytics/2.0.0?topic=only-configure-event-notifications
------------------------------
William Smith
Original Message:
Sent: Thu August 11, 2022 10:02 AM
From: Svetlana Pestsova
Subject: Enabling email notification in PAW Local - error sending email
Hi Dong,
The documentation for this E-mail notification functionality is under review now.
I'll post the updated link as it'd be publicly available,
Best Regards,
------------------------------
Svetlana Pestsova
IBM Planning Analytics Product Manager
Original Message:
Sent: Thu August 11, 2022 09:46 AM
From: Dong Banh
Subject: Enabling email notification in PAW Local - error sending email
Thank you, Declan and Paul. Your suggestions both helped. I was able to get it working.
If IBM could update their documentation with more details like what you've included, Declan, I think that would help others trying to get this working with different mail servers. Especially which log file to review to find the error message in order to troubleshoot this issue.
------------------------------
-----------------------------
Dong Banh
Principal Consultant
GrandView Corporation
Original Message:
Sent: Fri August 05, 2022 07:16 PM
From: Declan Rodger
Subject: Enabling email notification in PAW Local - error sending email
Hi,
I would recommend working with someone from IT on this who is responsible for the organization's SMTP server – as different configurations will require different settings and they will be your best bet at understanding how your server is set up.
That being said, I was just testing the functionality and I certainly don't have a full understanding of email servers, nor do I have any desire to. So trial and error was sufficient for my purposes.
I got it set up and working for both an Office 365 account and a GMAIL account.
Getting Started
The obvious starting points are to gather details of your SMTP server, the port it uses (for sending email) – it can often have multiple ports available in which case – find out the "preferred" one. Generally speaking:
- 587 – for TLS
- 465 – For SSL
- 25 – This might work (it does for office 365 at least) but general consensus is to not use it as it's often blocked due to SPAM.
Also, gather the relevant account's email and password. If you are testing this out and using an account with MFA setup you will probably need to generate an "App Password" – this is a unique password that allows an app (e.g. PAW) to bypass the MFA with its own special password.
Relevant Material
Based on googling the examples provided in the documentation:
I believe that node.js is being used to send the emails, and nodemailer.com/smtp has documentation covering most of the parameters used in the examples (e.g. ?Secure=true)
This doesn't cover the tls.rejectUnauthorized=false that is used in the example, but looking that up suggests that in the event that your server can't be verified it will go ahead and send the email anyway… so that sounds like a parameter that I would be cautious about using!
What Worked
Office 365:
- $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587"
- $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587?secure=true&requireTLS=true"
- $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.office365.com:587?secure=false"
Gmail:
- $env:EMAIL_SMTP_URL="smtp://<MyUserName>:<MyPassword>@smtp.gmail.com:587"
- $env:EMAIL_SMTP_URL="smtps://<MyUserName>:<MyPassword>@smtp.gmail.com:465"
- $env:EMAIL_SMTP_URL="smtps://<MyUserName>:<MyPassword>@smtp.gmail.com:465?secure=true&tls.rejectUnauthorized=false"
In all cases:
- $env:ENABLE_EMAIL="true"
- $env:SENDGRID_API_KEY=""
- $env:EMAIL_FROM="<An email address that the credentials used in $env:EMAIL_SMTP_URL have access to send from>"
I have not yet tested/tried setting this up wit a Sendgrid API Key.
Errors
When you get an error that an email could not be sent, you will be able to see detailed error logs in the folder:
<PawDirectory>\log\share-app\
Generally speaking, if you are a novice like me on this stuff googling these error messages won't provide the EXACT answer for PAW but with a bit of deduction, they can point you in the right direction.
The errors I encountered:
- Error: 33020:error:1408F10B:SSL routines:ssl3_get_record:wrong version number:c:\ws\deps\openssl\openssl\ssl\record\ssl3_record.c:332:
- This appeared when trying to connect to TLS (587) port with the prefix smtps:// and I needed to replace with smtp://
- Error: Mail command failed: 451 5.7.3 STARTTLS is required to send mail
- This appeared when using "587?ignoreTLS=true" as per the example for 587… need to remove the "?ignoreTLS=true" section as why would you ever ignore TLS for the port that is specifically intended for TLS…
- Error: connect ETIMEDOUT 52.97.208.2:465
- This appeared when I stupidly tried to connect to Office 365 on port 465 which it doesn't use for SMTP
- I think this error will generally appear when you manage to reach the server but the port isn't open etc.
- Error: Invalid login: 535-5.7.8 Username and Password not accepted
- This is what happens if you have the wrong credentials… be happy if you see this as it means you have at least managed to shake hands with the email server!
- Error: Unexpected socket close
- This appeared when using only smtp:// prefix for the SSL port (465) – replaced with smtps:// and it worked.
- Error: Message failed: SendAsDenied; xxx@email.com not allowed to send as yyy@email.com
- Authentication worked but the EMAIL_FROM parameter is for an account that the authenticated one is not allowed to send from (this is a setting in your exchange server)
Assumptions
So, some assumptions that are based on my personal trial and error experience:
- smtps:// prefix seems to be for 465/SSL and smtp:// prefix for 587/TLS.
- In most cases you can probably get away without using the suffix parameters as the default settings work in most cases.
- ignoreTLS=true makes no sense in the example for TLS/587… conversely requireTLS=true worked.
------------------------------
Declan Rodger
Technical Director
Spitfire Analytics
Original Message:
Sent: Tue August 02, 2022 04:28 PM
From: Dong Banh
Subject: Enabling email notification in PAW Local - error sending email
One of the new features of Planning Analytics Workspace version 78 is that you can enable email notifications. I followed the instructions in the link below and was able to get the Email tab to appear. However, when I try to send an email, it says Sending Email Failed after trying to generate the email. I looked in the log files trying to find the error to figure out what was causing the error. Didn't seem to find the error in the logs. Anyone been able to successfully set this up and how did you troubleshoot any errors?
Enable email notifications in Planning Analytics Workspace Local
------------------------------
-----------------------------
Dong Banh
Principal Consultant
GrandView Corporation
-----------------------------
------------------------------