Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5850243
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T13:06:49+00:00 2026-05-22T13:06:49+00:00

I am using asp.net mvc 3 and quartz scheduler. Currently I have this A

  • 0

I am using asp.net mvc 3 and quartz scheduler.

Currently I have this

  1. A job gets created and executed.
  2. Goes to a controller where I map domain to view models with automapper
  3. Results go to controller where I want to use Action Mailer

I get an error

System.ArgumentNullException was unhandled by user code
  Message=Value cannot be null.
Parameter name: httpContext
  Source=System.Web
  ParamName=httpContext
  StackTrace:
       at System.Web.Routing.RequestContext..ctor(HttpContextBase httpContext, RouteData routeData)
       at ActionMailer.Net.MailerBase.Email(String viewName, Object model, String masterName)
       at EmailController.SendCalendarAppointmentNotifiation(CalendarAppointmentReminderVM vm) in EmailController.cs:line 73
       at RemindersController.CalendarAppointmentsReminders(List`1 taskReminders) in RemindersController.cs:line 54
       at QuartzJobs.AppointmentRemindersJob.Execute(JobExecutionContext context) in AppointmentRemindersJob.cs:line 39
       at Quartz.Core.JobRunShell.Run()
  InnerException: 

// Job

public void Execute(JobExecutionContext context)
        {


                            // some code to do some checking and to get results above(not shown)
                            RemindersController remindersController = new RemindersController();
                            remindersController.CalendarAppointmentsReminders(calendarAppointmentReminders);

            }

// controller (to do mapping)\

   public void CalendarAppointmentsReminders(List<AppointmentReminder> appointments)
        {
           List<CalendarAppointmentReminderVM> vm = Mapper.Map<List<CalendarAppointment>, List<CalendarAppointmentReminderVM>>(appointments.Select(x => x.CalendarAppointment).ToList());
            Mapper.Map<List<AppointmentReminder>, List<CalendarAppointmentReminderVM>>(appointments, vm);


            foreach (var v in vm)
            {
                new EmailController().SendCalendarAppointmentNotifiation(v);
            }

        }

// mvc mailer

 public EmailResult SendCalendarAppointmentNotifiation(CalendarAppointmentReminderVM vm)
        {
            To.Add(vm.To);
            Subject = String.Format("Subject");
            return Email("SendCalendarAppointmentEmail", vm);
        }

Dies right on return Email("SendCalendarAppointmentEmail", vm); I want to use this as I am using it to send out all my other emails and I find it alot better way to send emails(easier to make them look nicer as you can use master pages and strongly typed views).

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T13:06:50+00:00Added an answer on May 22, 2026 at 1:06 pm

    The Job execution of Quartz doesn’t run in a HttpRequest. Also HttpContext.Current is NULL.
    It seems that this asp.net mailer doesn’t work without the asp.net request environment (hava a look at StackTrace)

    checkout Render a view as a string (render view, put into mail and send..), but unfortunately in this post all samples works with the current ControllerContext/HttpContext too.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I wrote an application using ASP.NET MVC, in this application I have an Index
I am using ASP.NET MVC 2, .NET 4.0. I have a controller that disables
I am using quartz.net to schedule regular events within asp.net mvc application. The scheduled
Using ASP.Net MVC on my Site.Master I have: <head runat=server> <title><asp:ContentPlaceHolder ID=TitleContent runat=server />
Using ASP.NET MVC 2.0, I have an actionlink that is used for comments on
I am using ASP.NET MVC 1.0. I have an ActionResult which receives a form
using ASP.NET MVC 1.0 and I have a action that returns a JsonResult and
using ASP.NET MVC 2 I have a navigation menu inside my Master Page. In
I am using ASP.NET MVC architecture.I have a telerik window on a button click,
Using ASP.Net MVC 1.0 I have a form with some input control on it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.