# One week - same problem - no idea :S

**URL:** <https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375>\
**Category:** Rails\
**Created:** [January 22, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375 "2009-01-22T17:40:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [January 22, 2009, 5:40pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375/1 "2009-01-22T17:40:25Z")

</div>

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](http://server.600host.net)”,  
:port =\> “465”,  
:domain =\> “[mydomain.com](http://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?

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [January 22, 2009, 5:52pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375/2 "2009-01-22T17:52:58Z")

</div>

> :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](http://agilewebdevelopment.com/plugins/actionmailer_tls)

Cheers  
Luke

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [January 22, 2009, 6:29pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375/3 "2009-01-22T18:29:29Z")

</div>

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](http://mail.thinkersplayground.com)  
Incoming Mail Server: (SSL) [server.600host.net](http://server.600host.net)  
Outgoing Mail Server: [mail.thinkersplayground.com](http://mail.thinkersplayground.com) (server requires  
authentication) port 25  
Outgoing Mail Server: (SSL) [server.600host.net](http://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](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [January 22, 2009, 7:16pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375/4 "2009-01-22T19:16:01Z")

</div>

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](http://mail.thinkersplayground.com)  
> Incoming Mail Server: (SSL) [server.600host.net](http://server.600host.net)  
> Outgoing Mail Server: [mail.thinkersplayground.com](http://mail.thinkersplayground.com) (server requires  
> authentication) port 25  
> Outgoing Mail Server: (SSL) [server.600host.net](http://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](mailto: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](http://mail.thinkersplayground.com)”,  
:port =\> 25,  
:domain =\> “[thinkersplayground.com](http://thinkersplayground.com)”,  
:authentication =\> :login,  
:user\_name =\> “removed\_email\_address@domain.invalid”,  
:password =\> “yourpassword”  
}

---

<div class="post-metadata">

**Author:** ![gavin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/439d5e/32.png) [@gavin](https://www.ruby-forum.com/u/gavin)\
**Post date:** [January 22, 2009, 7:42pm UTC](https://www.ruby-forum.com/t/one-week-same-problem-no-idea-s/158375/5 "2009-01-22T19:42:26Z")

</div>

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](mailto:removed_email_address@domain.invalid)
