Forum: Ruby on Rails SocketError in EmailController#correspond

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Fcccf150cc0ea29f6b0295abd345126b?d=identicon&s=25 Aoife Donovan (aoifeoz)
on 2009-02-08 13:49
SocketError in EmailController#correspond
getaddrinfo: no address associated with hostname.

Please see above, these are the errors i get when i try to email a user
on my networking site. Can you help please.

Actionmailer address = smtp.vodafone.ie

Below is code used for the email controller in
apps/controllers/email_controller.rb There doesnt seem to be any code
missing. Can someone help with this error, are there any possible
solutions???

Thanks.

class EmailController < ApplicationController
  layout "site"
  include ApplicationHelper
  include ProfileHelper
  before_filter :protect, :only => [ "correspond" ]



  def remind
    @title = "Mail me my login information"
    if param_posted?(:user)
      email = params[:user][:email]
      user  = User.find_by_email(email)
      if user
        UserMailer.deliver_reminder(user)
        flash[:notice] = "Login information was sent."
        redirect_to :action => "index", :controller => "site"
      else
        flash[:notice] = "There is no user with that email address."
      end
    end
  end

def correspond
    user = User.find(session[:user_id])
    recipient = User.find_by_user_name(params[:id])
    @title = "Email #{recipient.name}"
    if param_posted?(:message)
      @message = Message.new(params[:message])
      if @message.valid?
        UserMailer.deliver_message(
          :user => user,
          :recipient => recipient,
          :message => @message,
          :user_url => profile_for(user),
          :reply_url => url_for(:action => "correspond",
                                :id => user.user_name)
        )
        flash[:notice] = "Email sent."
        redirect_to profile_for(recipient)
      end
    end
  end
end
1128ccdc6b414a39e38f00acca680b8d?d=identicon&s=25 stretch (Guest)
on 2009-02-08 15:32
(Received via mailing list)
Aoife,

does your server have a DNS server set in the network settings so it
can determine the ip address for that domain?

Just did an nslookup on that domain:

tretch$ nslookup smtp.vodafone.ie
Server:    68.87.76.178
Address:  68.87.76.178#53

Non-authoritative answer:
*** Can't find smtp.vodafone.ie: No answer

Sounds like it can't be found. ping doesn't work either.

Al

On Feb 8, 4:49 am, Aoife Donovan <rails-mailing-l...@andreas-s.net>
Fcccf150cc0ea29f6b0295abd345126b?d=identicon&s=25 Aoife Donovan (aoifeoz)
on 2009-02-08 16:25
stretch wrote:
> Aoife,
>
> does your server have a DNS server set in the network settings so it
> can determine the ip address for that domain?
>
> Just did an nslookup on that domain:
>
> tretch$ nslookup smtp.vodafone.ie
> Server:    68.87.76.178
> Address:  68.87.76.178#53
>
> Non-authoritative answer:
> *** Can't find smtp.vodafone.ie: No answer
>
> Sounds like it can't be found. ping doesn't work either.
>
> Al
>
> On Feb 8, 4:49�am, Aoife Donovan <rails-mailing-l...@andreas-s.net>
Hi,

Thanks for that. Yes i didnt actually find that address anywhere i just
assumed it was correct as it was used by another person, i found out
previously through another forum.

I have just changed over to my eircom broadband and used the
smtp.eircom.net address which i have found to be correct. But im still
getting an error, it's now saying it is rejecting the address but they
are both valid email addresses. What could i be leaving out?? Im lost
with this one!

Thanks in advance,

Aoife.

Current Error:
Net::SMTPFatalError in EmailController#correspond
553 sorry, syntax error or rejected address, please forward to your
postmaster (#5.7.1)



Application Trace | Framework Trace | Full Trace
C:/Ruby/lib/ruby/1.8/net/smtp.rb:679:in `check_response'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:652:in `getok'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:630:in `mailfrom'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:543:in `send0'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:471:in `sendmail'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:588:in
`perform_delivery_smtp'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:378:in `start'
C:/Ruby/lib/ruby/1.8/net/smtp.rb:315:in `start'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:586:in
`perform_delivery_smtp'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in
`__send__'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:469:in
`deliver!'
C:/Ruby/lib/ruby/gems/1.8/gems/actionmailer-2.0.2/lib/action_mailer/base.rb:352:in
`method_missing'
app/controllers/email_controller.rb:31:in `correspond'
This topic is locked and can not be replied to.