getting the action mailer recipe to actually work, no thanks to default setup not playing nice with local postfix :-/
This commit is contained in:
parent
5de7f2bd3a
commit
4bad1c5bdd
@ -4,7 +4,7 @@ require 'action_mailer'
|
||||
|
||||
class SimpleMailer < ActionMailer::Base
|
||||
def simple_message(recipient)
|
||||
from 'dan@meatballhat.com'
|
||||
from 'daniel.buch@gmail.com'
|
||||
recipients recipient
|
||||
subject 'A single-part message for you'
|
||||
body 'This message has a plain text body.'
|
||||
@ -13,12 +13,16 @@ end
|
||||
|
||||
|
||||
puts 'generated message:'
|
||||
puts SimpleMailer.simple_message('me@localhost')
|
||||
puts SimpleMailer.simple_message('daniel.buch+rubytest@gmail.com')
|
||||
|
||||
ActionMailer::Base.sendmail_settings = {
|
||||
:address => 'localhost',
|
||||
:port => 25,
|
||||
:domain => 'localhost'
|
||||
|
||||
ActionMailer::Base.smtp_settings = {
|
||||
:tls => true,
|
||||
:address => 'smtp.gmail.com',
|
||||
:port => "587",
|
||||
:domain => 'gmail.com',
|
||||
:user_name => 'daniel.buch@gmail.com',
|
||||
:password => STDIN.readline
|
||||
}
|
||||
|
||||
SimpleMailer.simple_message('me@localhost').deliver
|
||||
SimpleMailer.simple_message('daniel.buch+rubytest@gmail.com').deliver
|
||||
|
Loading…
Reference in New Issue
Block a user