Developer forum

Forum » Integration » BatchIntegrationScheduledTaskAddin - SendEmail method

BatchIntegrationScheduledTaskAddin - SendEmail method

Rui Silva
Reply

I've noticed in some schedule tasks that they not always finish execution with success.

I’ve did some debugging and taken a look at the source code and noticed that the method SendMail validates that has the properties NotificationTemplate and NotificationEmail are filled to create an email message object and send the email.

The issue that I’ve found is related with the sender address and email at the line (in BatchIntegrationScheduledTaskAddin.cs file):

From = new System.Net.Mail.MailAddress(NotificationEmailSenderEmail, NotificationEmailSenderName, System.Text.Encoding.UTF8)

This constructor of the MailAddress class will throw an exception (https://msdn.microsoft.com/en-us/library/f52hswkf(v=vs.110).aspx#Exceptions) when one of the first two parameters are null or empty. This exception is not catch and makes the schedule task to end execution without success.

My suggestion is to use the NotificationEmail property as a default value to build the sender address.

 

Best,

Rui Silva


Replies

 
Dmitriy Benyuk Dynamicweb Employee
Dmitriy Benyuk
Reply

Hi Rui,
thanks for finding this problem. It will be fixed in TFS# 31933.
Best regards, Dmitrij

 

You must be logged in to post in the forum