class Mail::Sendmail

mail.deliver!
end
body ‘testing sendmail’
subject ‘testing sendmail’
from ‘ada@test.lindsaar.net’
to ‘mikel@test.lindsaar.net’
mail = Mail.new do
Or by calling deliver on a Mail message
end
body ‘testing sendmail’
subject ‘testing sendmail’
from ‘ada@test.lindsaar.net’
to ‘mikel@test.lindsaar.net’
Mail.deliver do
Then just deliver the email as normal:
end
delivery_method :sendmail, :location => ‘/absolute/path/to/your/sendmail’
Mail.defaults do
Or if your sendmail binary is not at ‘/usr/sbin/sendmail’
end
delivery_method :sendmail
Mail.defaults do
be your sendmail location.
if you are on a mac or unix box, it is usually in /usr/sbin/sendmail, this will
To use this, first find out where the sendmail binary is on your computer,
A delivery method implementation which sends via sendmail.

def deliver!(mail)

def deliver!(mail)
  envelope_from = mail.return_path || mail.sender || mail.from_addrs.first
  return_path = "-f \"#{envelope_from}\"" if envelope_from
  arguments = [settings[:arguments], return_path].compact.join(" ")
  
  Sendmail.call(settings[:location], arguments, mail.destinations.join(" "), mail)
end

def initialize(values)

def initialize(values)
  self.settings = { :location       => '/usr/sbin/sendmail',
                    :arguments      => '-i -t' }.merge(values)
end