Email errors

(Dark Ambient) #1

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 'me@mydomain.com'
        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',
                                        :port => 25,
                                        :domain => 'mydomain.com',
                                        :user_name => 'username@mydomain.com',
                                        :password => 'password',
                                        :authentiation => :login }

puts SimpleMailer.deliver_simple_message('myname@google.com')

(Dark Ambient) #2

I think I had an error in the address , now that's it's corrected I
get a new error:

`check_response': 504 CRAM-MD5 authentication mechanism not supported
(Net::SMTPSyntaxError)

···

On 8/23/06, Dark Ambient <sambient@gmail.com> wrote:

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 'me@mydomain.com'
        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',
                                        :port => 25,
                                        :domain => 'mydomain.com',
                                        :user_name => 'username@mydomain.com',
                                        :password => 'password',
                                        :authentiation => :login }

puts SimpleMailer.deliver_simple_message('myname@google.com')

(ts) #3

`check_response': 504 CRAM-MD5 authentication mechanism not supported
(Net::SMTPSyntaxError)

Net::SMTP use CRAM-MD5 if an user is given and no authentification
mechamnism is given

:authentiation => :login }

   ^^^^^^^^^^^^^^

strange english word :slight_smile:

Guy Decoux

(Dark Ambient) #4

I thought typos were one of the syntactic sugars of Ruby.
:slight_smile:

Stuart

···

On 8/23/06, ts <decoux@moulon.inra.fr> wrote:

> `check_response': 504 CRAM-MD5 authentication mechanism not supported
> (Net::SMTPSyntaxError)

Net::SMTP use CRAM-MD5 if an user is given and no authentification
mechamnism is given

>> :authentiation => :login }
   ^^^^^^^^^^^^^^

strange english word :slight_smile:

Guy Decoux

(Francis Cianfrocca) #5

More like syntactic chili powder :wink:

···

On 8/23/06, Dark Ambient <sambient@gmail.com> wrote:

I thought typos were one of the syntactic sugars of Ruby.