Forum: Ruby on Rails One week - same problem - no idea :S

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.
Gavin (Guest)
on 2009-01-22 18:40
(Received via mailing list)
Hey guys - I've been struggling for over a week to get my action
mailer working - I've built a second application and I get the same
problems.
I'm pretty sure the problem must be with my smtp settings - according
to everything I've read, these are correct though, is there anyone out
there who can help?

In my environment.rb I have:

ActionMailer::Base.raise_delivery_errors = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
  :address => "server.600host.net",
  :port => "465",
  :domain => "mydomain.com",
  :authentication => :login,
  :user_name => "removed_email_address@domain.invalid", # is this the email 
address from
which I'm sending mail?
  :password => "password"
}

This gives:
Timeout::Error (execution expired)

Other combinations of smtp settings give me either:
SocketError: getaddrinfo: Name or service not known
or
OpenSSL::SSL::SSLError: hostname was not match with the server

What am I doing wrong?
Luke P. (Guest)
on 2009-01-22 18:52
>   :user_name => "removed_email_address@domain.invalid", # is this the email address from
> which I'm sending mail?

It's the login for that email account (generally the email address you
are sending from)

Possibly its because its a tls (secure) connection (usually you'd
connect to port 25) - you may need a rails plugin to get it to work:

http://agilewebdevelopment.com/plugins/actionmailer_tls

Cheers
Luke
Gavin (Guest)
on 2009-01-22 19:29
(Received via mailing list)
Thanks for that Luke

I gave it a go with my host's smtp settings - no luck! I still get the
Timeout::Error: execution expired

But when I tried with my gmail account settings it does work

I'm guessing the settings I've stated are wrong. Any ideas what they
should be set to?

My host specifes:
Incoming Mail Server: mail.thinkersplayground.com
Incoming Mail Server: (SSL) server.600host.net
Outgoing Mail Server: mail.thinkersplayground.com (server requires
authentication) port 25
Outgoing Mail Server: (SSL) server.600host.net (server requires
authentication) port 465
Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS
(SSL/TLS)
Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)

Should I set the domain to localhost?




On 22 Jan, 16:52, Luke P. <removed_email_address@domain.invalid>
Luke P. (Guest)
on 2009-01-22 20:16
Gavin wrote:
> Thanks for that Luke
>
> I gave it a go with my host's smtp settings - no luck! I still get the
> Timeout::Error: execution expired
>
> But when I tried with my gmail account settings it does work
>
> I'm guessing the settings I've stated are wrong. Any ideas what they
> should be set to?
>
> My host specifes:
> Incoming Mail Server: mail.thinkersplayground.com
> Incoming Mail Server: (SSL) server.600host.net
> Outgoing Mail Server: mail.thinkersplayground.com (server requires
> authentication) port 25
> Outgoing Mail Server: (SSL) server.600host.net (server requires
> authentication) port 465
> Supported Incoming Mail Protocols: POP3, POP3S (SSL/TLS), IMAP, IMAPS
> (SSL/TLS)
> Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS)
>
> Should I set the domain to localhost?
>
>
>
>
> On 22 Jan, 16:52, Luke P. <removed_email_address@domain.invalid>

Looks like you've got 2 lots of settings can you try the non-tls ones:

ActionMailer::Base.smtp_settings = {
  :address => "mail.thinkersplayground.com",
  :port => 25,
  :domain => "thinkersplayground.com",
  :authentication => :login,
  :user_name => "removed_email_address@domain.invalid",
  :password => "yourpassword"
}
Gavin (Guest)
on 2009-01-22 20:42
(Received via mailing list)
Luke - I swear to god I've been trying those settings all week to no
avail.
I can only assume the plugin you recommended is what helped.

Anyways - I really appreciate your help mate, mailer is working great
now

:)

Thanks

On 22 Jan, 18:16, Luke P. <removed_email_address@domain.invalid>
This topic is locked and can not be replied to.