Emails are sent when logged into Kentico admin

Srikrishna Podduturi asked on November 7, 2019 12:23

Hi Team,

We are using Kentico 12 for our website. We are using Kentico form builder for forms. The issue is that emails are not sent immediately after a form is submitted. Emails are found in the Email queue and they are sent only when we login to the Kentico admin portal. Could you please advise what changes to be made for emails to be sent immediately.

Thanks, Krishna.

Recent Answers

Peter Mogilnitski answered on November 7, 2019 13:33

This is not a default behavior. Do you have any custom code on authenticate event that does that? There are couple keys in web.config CMSLogEmails and CMSDebugEmails. I'd suggest you use them to debug and understand the sequence of events.

0 votesVote for this answer Mark as a Correct answer

Dmitry Bastron answered on November 7, 2019 13:35

Hi Krishna,

You can disable the queue for emails. If you go to the Settings application, under System > Emails there is a setting Enable email queue which you can disable. And all the emails will go straight.

Another option is to check your settings for Send queued emails task in Scheduled tasks application. Check if it's enabled and set up to be run every minute. This could help as well.

0 votesVote for this answer Mark as a Correct answer

Juraj Ondrus answered on November 7, 2019 13:38

It looks like there is no activity on the Kentico admin side. The emails from the Email Queue are sent by a scheduled task. And the scheduler is running only when the Kentico application is up and running and, by default, there has to be some request made - the default scheduler is request based (for more details please see the documentation). Or, you can use the Automatic scheduler mode, but the Kentico application must be alive (always on).
Task execution by the Kentico application runs within the ASP.NET process, so tasks cannot be executed if the web application is not running. The application stops running when the process is recycled without being started again (after a long period of website inactivity). If you want to run the scheduling reliably, we recommend using the Windows scheduling service. EMS license required.
To achieve reliable task execution without using the Windows scheduling service, you need to ensure that your website is always running. For example, you can prepare a utility or service that requests the home of your website on a regular basis.

1 votesVote for this answer Mark as a Correct answer

Roman Hutnyk answered on November 7, 2019 15:25

Sometimes health monitors a being used to check if site is alive: basically they send a request to the site and if they get expected result they threat web site as up and running.

Side effect of that process is that site is always up and 'warm' and all scheduled task are being executed in time.

So what I'm trying to say is that you need some job that will ping your site (admin in your case) from time to time and it should solve the issue you have.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.