Email Doesn't Always Send


Badge +1

I'm having a problem with a K2 workflow.  The workflow has been functioning properly for months but recently it started behaving strangely.  I have an email event at the end fo the workflow and this event doesn't always send out email.  K2 doesn't return any errors and the rest of the process runs without a problem.  

 

I thought it was a problem with our SMTP server, but the logs don't even show that a message was processed in some cases.  Some users always get their notification email, some never get it, and as far as we can tell, K2 never even tries to send the mail.  I've looked through the K2 logs and there doesn't seem to be anything indicating an error.  I've tried recompiling and redeploying the workflow but that didn't help.  


5 replies

Badge +10

What type of event is triggering the mail?

Badge +1

I'm using a MailEvent to send the email.

It is set up to send after the preceding Activity completes. That activity contains a DataEvent and then an IPCEvent. The thing is that we know the event is finishing successfully because the data it manipulates is being successfully changed in every circumstance, whereas the email that should follow those changes isn't always generated, when it should always be.
Badge +6

Email Event uses the Microsoft SMTP api. So if the mail fails to send from the Mail Event, the instance would go into error state. 


 


If your process instance does not go into error state, it meant that the Mail has been sent. I've seen this before where the mails intermittenly fail to send and does not log error anywhere. Usually, this occurs when the Mail Server is under heavy load, and hence, it does not process the email. 

Badge +1

Thank you for the response.  But if the mail server is under a heavy load, should we not see evidence on the mail server of a connection being opened by the K2 server?  We've looked at our SMTP logs and in some cases there is no record that the server even got a connection from K2.  For one user, the SMTP server never shows an email or connection from this particular workflow.

Badge +10

For email events, there usually are not as many moving parts as for some others (like client event notifications).


 


I'd start troubleshooting by checking the K2 hostserver log for errors when a workflow tries to send an email.  You may want to run a test instance and then go grab the log.  Any errors should be towards the bottom in that case.


 


Further, you can verify the connection strings being used via the connection string editor.  Ensure all values in there are correct and valid for your SMTP server.


 


I've also seen a situation where the exchange server or a domain controller goes down for whatever reason, and K2 isn't able to recover it's connection.  In that case, restarting the blackpearl service usually will do the trick.

Reply