D
Dark Ambient
I'm working on this recipie from the Ruby Cookbook, but receiving
errors. Not sure if this is code related or system related. I'm
attempting to send mail via my ISP's smtp server.
To protect the innocent I took out the real names of domains , etc.
Errors:
:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `initialize':
getaddrinfo: no address associated with hostname. (SocketError)
from C:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
from C:/instantrails/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
from C:/instantrails/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
from C:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:393:in `do_start'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start'
from C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:447:in
`perform_delivery_smtp' from
C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:333:in
`deliver!' from
C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:227:in
`method_missing' from C:/InstantRails/ruby_progs/simplemailer.rb:24
Program:
#!/usr/bin/env ruby
require 'rubygems'
require 'action_mailer'
class SimpleMailer < ActionMailer::Base
def simple_message(recipient)
from '(e-mail address removed)'
recipients recipient
subject 'A single-part message for you'
body 'This message has a plain text body'
end
end
ActionMailer::Base.server_settings = { :address => 'smtp.mydomain.com',
ort => 25,
:domain => 'mydomain.com',
:user_name => '(e-mail address removed)',
assword => 'password',
:authentiation => :login }
puts SimpleMailer.deliver_simple_message('(e-mail address removed)')
errors. Not sure if this is code related or system related. I'm
attempting to send mail via my ISP's smtp server.
To protect the innocent I took out the real names of domains , etc.
Errors:
:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `initialize':
getaddrinfo: no address associated with hostname. (SocketError)
from C:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
from C:/instantrails/ruby/lib/ruby/1.8/timeout.rb:56:in `timeout'
from C:/instantrails/ruby/lib/ruby/1.8/timeout.rb:76:in `timeout'
from C:/instantrails/ruby/lib/ruby/1.8/net/protocol.rb:206:in `old_open'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:393:in `do_start'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:378:in `start'
from C:/instantrails/ruby/lib/ruby/1.8/net/smtp.rb:316:in `start'
from C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:447:in
`perform_delivery_smtp' from
C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:333:in
`deliver!' from
C:/instantrails/ruby/lib/ruby/gems/1.8/gems/actionmailer-1.2.3/lib/action_mailer/base.rb:227:in
`method_missing' from C:/InstantRails/ruby_progs/simplemailer.rb:24
Program:
#!/usr/bin/env ruby
require 'rubygems'
require 'action_mailer'
class SimpleMailer < ActionMailer::Base
def simple_message(recipient)
from '(e-mail address removed)'
recipients recipient
subject 'A single-part message for you'
body 'This message has a plain text body'
end
end
ActionMailer::Base.server_settings = { :address => 'smtp.mydomain.com',
ort => 25,
:domain => 'mydomain.com',
:user_name => '(e-mail address removed)',
assword => 'password',
:authentiation => :login }
puts SimpleMailer.deliver_simple_message('(e-mail address removed)')