I have following line of code for queueing up an emailing task that is supposed to send out an email when executed successfully. When I run the original method of SendEmail then the email is sent out successfully so that means original method has no issues, but with Hangfire Enqueue method no email gets sent even though on dashboard the scheduled job shows up to have run successfully.
Question: Why is Hangfire behaving in above manner? I think I may be missing some configuration, even though I have set up the startup class according to documentation. Or is it the VB.Net syntax that is not correct?
Hangfire.BackgroundJob.Enqueue(Sub() ABC.Utilities.Helper.SendEmail(prod.ProductEmailAddresses, cp.UserEmail, String.Format(subject, prod.ProductName), String.Format(body, prod.ProductName, cp.UserFullName), EmailMessageFormats.Html, String.Empty))