Skip to content

Commit

Permalink
Removed old method of setting delivery_method
Browse files Browse the repository at this point in the history
  • Loading branch information
mikel committed Jan 26, 2010
1 parent 103af02 commit 1b55cfd
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions README.rdoc
Expand Up @@ -219,11 +219,9 @@ what you are doing.

=== Sending an email:

require 'mail'

Mail.defaults do
smtp '127.0.0.1', 25
end
Mail defaults to sending via SMTP to local host port 25. If you have a
sendmail or postfix daemon running on on this port, sending email is as
easy as:

Mail.deliver do
from 'me@test.lindsaar.net'
Expand All @@ -235,10 +233,6 @@ what you are doing.

or

Mail.defaults do
smtp '127.0.0.1' # Port 25 defult
end

mail = Mail.new do
from 'me@test.lindsaar.net'
to 'you@test.lindsaar.net'
Expand All @@ -249,6 +243,22 @@ or

mail.deliver!

Sending via sendmail can be done like so:

mail = Mail.new do
from 'me@test.lindsaar.net'
to 'you@test.lindsaar.net'
subject 'Here is the image you wanted'
body File.read('body.txt')
add_file {:filename => 'somefile.png', :content => File.read('/somefile.png')}
end

mail.delivery_method :sendmail

mail.deliver

mail.deliver!


=== Getting emails from a pop server:

Expand Down Expand Up @@ -344,10 +354,6 @@ simple as possible.... (asking a lot from a mail library)

require 'mail'

Mail.defaults do
smtp '127.0.0.1' # Port 25 defult
end

mail = Mail.deliver do
to 'nicolas@test.lindsaar.net.au'
from 'Mikel Lindsaar <mikel@test.lindsaar.net.au>'
Expand Down

0 comments on commit 1b55cfd

Please sign in to comment.