Weird SSRS & APR Emailing Errors

Trying to get Print Routing setup but I was getting the following Error in System Monitor and no email was delivered to my inbox:

An error occurred while performing print routing action Email Report:Failure sending mail.
Type: APR Error
Email Err: 1;

I tested BPM Emailing (standard, no code) and that works fine a plain email come right through.

I then tested ‘manually’ emailing the report with the SSRS Email option from the toolbar since I suspected both APR & SSRS emailing uses the same backend functionality:
image

This also resulted in an error message in the System Monitor, but slightly different:

Program Ice.Services.Lib.RunTask raised an unexpected exception with the following message: RunTask:System.Net.Mail.SmtpException: Failure sending mail. —> System.IO.IOException: Unable to read data from the transport connection: net_io_connectionclosed.

I checked the Company Maintenance SMTP & Global Alert settings and even trying variations and nothing resulted in a successful result.
I then compared with another client and theirs work fine with similar settings.
The only real difference (other than the SMTP Server) is the Port. The non-working environment is using port 25 (relay only?) and the working environment is using Port 587

It seems to me that the SSRS Email and APR email sending is more interactive with the email server whereas the plain BPM Email is not.

Does anyone have any advice or experience with this type of problem?
Thanks!

Port 25 is unsecured while 587 is using TLS.

https://kinsta.com/blog/smtp-port/

Thanks Mark, I did understand the difference between the ports, but when I try to use 587 the server does not respond.

Does this mean that SSRS Emails require TLS or something? Is there a server setting for that?
Just hard to troubleshoot the black box when I don’t know what the requirements are.
I reviewed several Epicor Admin guides and there isn’t much guidance nor is any distinction between a plain BPM email and an SSRS Email in regards to email server authentication.

I am trying to determine from the SysAdmin if the SMTP server is really their primary email provider or if they also use something else which could be used.

The SMTPMailer reads the company SSL Checkbox so it should honor whatever you have in Company Maintenance.

The ServerLog if enabled will usually give you more information.

How did you test the BPM when you mentioned that it worked, did you use the BPM Widget or Code and did you run async or sync BPM.

If you do use 587 you may need to check Use SSL in Company Maintenance… oddly enough we require it for our port 25 relay :slight_smile:

image

1 Like

Thanks Haso, that’s helpful.
the SSL Checkbox is not enabled, I don’t know if the Email Server will even accept that.
I will check the ServerLog.

I always use BPM Widgets now, and sync.
The BPM works fine, it’s the SSRS Email function and APR Email Widgets that produce the error.

When you manually email a report, what are you using as the From email address? Does it match the one setup in the Company Maintenance settings (the “Global Alert From address”) ?

So that is helpful, but what I don’t understand is why the SSRS Mailer has different requirements than the Mailer that BPM’s use.
According to my logs the BPM Mailer is using:

System.Net.Mail.SmtpClient.Send

and the SSRS Mailer is using:

Ice.Core.SsrsReporting.EmailSender.Send

???

Calvin,
When you use the ‘manual’ SSRS Email option there is no option for the From Email address.

In the BPM that works, I did set the From Email Address to be the same as the Company Maintenance From Address, but I thought I also tested a different email address (same domain) and that worked too.

The BPM just uses the SMTP Client directly.

The SSRS just has it wrapped, so they can parse Addresses and Attachments and what not.

var smtpClient = new SmtpClient(settings.SmtpServer, settings.SmtpPort);
smtpClient.Timeout = 30000;
smtpClient.EnableSsl = settings.SmtpEnableSsl; // settings is from Company Maintenance

Try sending a BPM Email using async. If I recall the SSRS sends it from the Task Agent… If your TA is on a different host than AppServer, that host may not be white-listed or if you are using 127.0.0.1 or something local it may not know of 127.0.0.1 like the AppServer does.

Which would explain why BPM synchronous works since it runs on AppServer and SSRS doesn’t… Try doing a async email widget in BPM.