EmailQueueManager Error in Event Log

Jim Piller asked on August 28, 2019 21:16

Recently I've tried setting up the Email Marketing stuff on my local machine. I thought I had everything setup and then I checked the event log and saw that this error is repeating several times per second!! Not sure what checkbox I missed or what setting I didn't add, but I don't want to deploy this code anywhere until I resolve this issue.

My SMTP server is currently SendGrid and it's only for local testing and development. I'm using my sendgrid user name and password w/ SSL enable in the System settings under Emails.

Server Name: smtp.sengrid.net Tried both SSL turned on and off.

Message: Object reference not set to an instance of an object.

Exception type: System.NullReferenceException Stack trace: at AngleSharp.AutoSelectedMarkupFormatter.Comment(IComment comment) at AngleSharp.Dom.Comment.ToHtml(TextWriter writer, IMarkupFormatter formatter) at AngleSharp.Dom.Collections.NodeList.ToHtml(TextWriter writer, IMarkupFormatter formatter) at AngleSharp.Extensions.FormatExtensions.ToHtml(IMarkupFormattable markup, IMarkupFormatter formatter) at PreMailer.Net.PreMailer.MoveCssInline(Boolean removeStyleElements, String ignoreElements, String css, Boolean stripIdAndClassAttributes, Boolean removeComments) at CMS.Newsletters.PreMailerCssInliner.InlineCss(String htmlSource, Uri baseUri) at CMS.Newsletters.EmailParts.GetBody() at CMS.Newsletters.EmailMessageBuilder.GetMessage() at CMS.Newsletters.EmailQueueManager.SendEmail(EmailQueueItemInfo email, EmailParts emailParts, String siteName)

Correct Answer

Brenden Kehren answered on August 29, 2019 06:44

So we solved the email issue it sounds like correct? Now you have another question or error you want to resolve? The error you posted is not helpful, maybe post the whole error.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Brenden Kehren answered on August 28, 2019 21:28

Sendgrid is picky within Kentico. You need to specify the URL like so with a port number smtp.sendgrid.net:587 AND do NOT use SSL, it's not required and will error out.

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on August 28, 2019 22:28

Hey Brenden,

Thanks, that stopped the constant error showing up in the Event Log, however, I'm still getting the same null reference error and the sender in the Event Log is particularly confusing:

DraftSender+<>c__DisplayClass5_0

This happens when I try to send a draft of the email. Any thoughts on what is causing this?

0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on August 28, 2019 22:31

Is this out of the box configuration or something different like custom code? And what version?

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on August 28, 2019 22:32 (last edited on August 28, 2019 22:34)

This is totally out of the box config, no custom code. Version is Kentico 12.0.33. The only custom code I have related to this right is for the unsubscribe page, and I got that code directly out of the kentico documentation here:

Email Document

0 votesVote for this answer Mark as a Correct answer

Jim Piller answered on August 29, 2019 14:21

The entire error is the same as the one above w/ the source that I posted.

Source: DraftSender+<>c__DisplayClass5_0

Server Name: smtp.sengrid.net Tried both SSL turned on and off.

Message: Object reference not set to an instance of an object.

Exception type: System.NullReferenceException Stack trace: at AngleSharp.AutoSelectedMarkupFormatter.Comment(IComment comment) at AngleSharp.Dom.Comment.ToHtml(TextWriter writer, IMarkupFormatter formatter) at AngleSharp.Dom.Collections.NodeList.ToHtml(TextWriter writer, IMarkupFormatter formatter) at AngleSharp.Extensions.FormatExtensions.ToHtml(IMarkupFormattable markup, IMarkupFormatter formatter) at PreMailer.Net.PreMailer.MoveCssInline(Boolean removeStyleElements, String ignoreElements, String css, Boolean stripIdAndClassAttributes, Boolean removeComments) at CMS.Newsletters.PreMailerCssInliner.InlineCss(String htmlSource, Uri baseUri) at CMS.Newsletters.EmailParts.GetBody() at CMS.Newsletters.EmailMessageBuilder.GetMessage() at CMS.Newsletters.EmailQueueManager.SendEmail(EmailQueueItemInfo email, EmailParts emailParts, String siteName)

0 votesVote for this answer Mark as a Correct answer

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