Index: lib/action_mailer/ar_sendmail.rb
===================================================================
--- lib/action_mailer/ar_sendmail.rb	(revision 796)
+++ lib/action_mailer/ar_sendmail.rb	(working copy)
@@ -109,6 +109,7 @@
       t.column :to, :string
       t.column :last_send_attempt, :integer, :default => 0
       t.column :mail, :text
+      t.column :send_on, :date
       t.column :created_on, :datetime
     end
   end
@@ -127,6 +128,28 @@
     require 'active_support'
     puts <<-EOF
 class #{table_name.classify} < ActiveRecord::Base
+  # To send email on a later date, call Email.set_send_on(Date.parse(params[:send_on]) just prior to Notifier.deliver_... call
+
+  named_scope :ready_to_send, lambda { { :conditions => [ 'send_on IS NULL or send_on <= ?', Date.today ] } }
+
+  before_create :set_instance_send_on
+  after_create :clear_class_send_on
+
+  @@send_on = nil
+
+  def self.set_send_on(val)
+    @@send_on = val
+  end
+
+  private
+
+  def set_instance_send_on
+    self.send_on = @@send_on if self.send_on.nil?
+  end
+
+  def clear_class_send_on
+    @@send_on = nil
+  end
 end
     EOF
   end
@@ -140,7 +163,7 @@
 
   def self.mailq(table_name)
     klass = table_name.split('::').inject(Object) { |k,n| k.const_get n }
-    emails = klass.find :all
+    emails = klass.send :ready_to_send
 
     if emails.empty? then
       puts "Mail queue is empty"
@@ -474,7 +497,7 @@
   def find_emails
     options = { :conditions => ['last_send_attempt < ?', Time.now.to_i - 300] }
     options[:limit] = batch_size unless batch_size.nil?
-    mail = @email_class.find :all, options
+    mail = @email_class.ready_to_send.find :all, options
 
     log "found #{mail.length} emails to send"
     mail
