Hey - can anyone spare a few minutes to explain how to set-up actionmailer in Rails 2.2.2 I have read the API but still not sure if I''m changing the correct file? I am going nuts with this! Do I add my smtp settings to environment.rb or edit them in base.rb in the actionmailer folder? The error message I receive when trying to send emails is SocketError: getaddrinfo: Name or service not known If anyone can spare a few mins either on this thread or on MSN/Skype/ Google chat I would really appreciate it Ta Gavin --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Agustin Nicolas Viñao Laseras
2009-Jan-19 15:16 UTC
Re: Still cant get ActionMailer to work!
What mail do you need to setup? Gmail smtp? or a host provided mail? In my case i use this in envirotment.rb ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.perform_deliveries = true ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "smtp.gmail.com", :port => "587", :domain => "domain.com", :authentication => :plain, :user_name => "user@domaincom", :password => "password" } And i generate the mail controller with: ruby script/generate mailer Notifier Notifier is the controller to send mails. On Mon, Jan 19, 2009 at 1:10 PM, Dr_Gavin <gavin-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org>wrote:> > Hey - can anyone spare a few minutes to explain how to set-up > actionmailer in Rails 2.2.2 > I have read the API but still not sure if I''m changing the correct > file? > I am going nuts with this! > > Do I add my smtp settings to environment.rb or edit them in base.rb > in the actionmailer folder? > > The error message I receive when trying to send emails is > > SocketError: getaddrinfo: Name or service not known > > If anyone can spare a few mins either on this thread or on MSN/Skype/ > Google chat I would really appreciate it > > Ta > > Gavin > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi - It''s a host provided mail account: my host is 600host.net my domain is thinkersplayground.com and the email is noreply-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org I tried adding the code you provided in my environment.rb (I did have it in prodcution.rb) and I now get an error: ...s/config/environment.rb:13:NameError: uninitialized constant ActionMailer The code I added was: ActionMailer::Base.raise_delivery_errors = true ActionMailer::Base.perform_deliveries = true ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.smtp_settings = { :address => "localhost", :port => 465, :domain => "thinkersplayground.com", :authentication => :login, :user_name => "noreply+thinkersplayground.com", :password => "password" } Any clues? Should this be config.action_mailer.smtp_settings = {} instead? thanks On 19 Jan, 15:16, "Agustin Nicolas Viñao Laseras" <agustinvi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> What mail do you need to setup? Gmail smtp? or a host provided mail? > > In my case i use this in envirotment.rb > ActionMailer::Base.raise_delivery_errors = true > ActionMailer::Base.perform_deliveries = true > ActionMailer::Base.delivery_method = :smtp > ActionMailer::Base.smtp_settings = { > :address => "smtp.gmail.com", > :port => "587", > :domain => "domain.com", > :authentication => :plain, > :user_name => "user@domaincom", > :password => "password" > > } > > And i generate the mail controller with: > > ruby script/generate mailer Notifier > > Notifier is the controller to send mails. > > On Mon, Jan 19, 2009 at 1:10 PM, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org>wrote: > > > > > Hey - can anyone spare a few minutes to explain how to set-up > > actionmailer in Rails 2.2.2 > > I have read the API but still not sure if I''m changing the correct > > file? > > I am going nuts with this! > > > Do I add my smtp settings to environment.rb or edit them in base.rb > > in the actionmailer folder? > > > The error message I receive when trying to send emails is > > > SocketError: getaddrinfo: Name or service not known > > > If anyone can spare a few mins either on this thread or on MSN/Skype/ > > Google chat I would really appreciate it > > > Ta > > > Gavin--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Hi -- On Mon, 19 Jan 2009, Dr_Gavin wrote:> > Hi - > It''s a host provided mail account: > > my host is 600host.net > my domain is thinkersplayground.com > and the email is noreply-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > I tried adding the code you provided in my environment.rb (I did have > it in prodcution.rb) and I now get an error: > > ...s/config/environment.rb:13:NameError: uninitialized constant > ActionMailerTry moving all that ActionMailer lines to the end of the file (after the RailsInitializer.run block is over). David -- David A. Black / Ruby Power and Light, LLC Ruby/Rails consulting & training: http://www.rubypal.com Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) http://www.wishsight.com => Independent, social wishlist management! --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Thanks David I''ve moved the code to the bottom of the file and that seems to have solved the recent error. Still have the error: SocketError: getaddrinfo: Name or service not known When trying to send mail though, any thoughts? Im a noob when it comes to SSL etc, is it possible this error is simply because my smtp settings are wrong? On 19 Jan, 15:32, "David A. Black" <dbl...-0o/XNnkTkwhBDgjK7y7TUQ@public.gmane.org> wrote:> Hi -- > > On Mon, 19 Jan 2009, Dr_Gavin wrote: > > > Hi - > > It''s a host provided mail account: > > > my host is 600host.net > > my domain is thinkersplayground.com > > and the email is nore...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > > I tried adding the code you provided in my environment.rb (I did have > > it in prodcution.rb) and I now get an error: > > > ...s/config/environment.rb:13:NameError: uninitialized constant > > ActionMailer > > Try moving all that ActionMailer lines to the end of the file (after > the RailsInitializer.run block is over). > > David > > -- > David A. Black / Ruby Power and Light, LLC > Ruby/Rails consulting & training:http://www.rubypal.com > Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) > > http://www.wishsight.com=> Independent, social wishlist management!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
According to my host''s setup instructions: Mail Server Username: noreply+thinkersplayground.com Outgoing Mail Server: mail.thinkersplayground.com (server requires authentication) port 25 Outgoing Mail Server: (SSL) server.600host.net (server requires authentication) port 465 Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) If actionmailer requires SSL then does that mean I need to set smtp settings to: :address => "server.600host.net", :port => 465, :domain => "thinkersplayground.com", :authentication => :login, :user_name => "noreply+thinkersplayground.com", :password => "password" ? On 19 Jan, 15:43, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote:> Thanks David > > I''ve moved the code to the bottom of the file and that seems to have > solved the recent error. > > Still have the error: > SocketError: getaddrinfo: Name or service not known > When trying to send mail though, any thoughts? > > Im a noob when it comes to SSL etc, is it possible this error is > simply because my smtp settings are wrong? > > On 19 Jan, 15:32, "David A. Black" <dbl...-0o/XNnkTkwhBDgjK7y7TUQ@public.gmane.org> wrote: > > > Hi -- > > > On Mon, 19 Jan 2009, Dr_Gavin wrote: > > > > Hi - > > > It''s a host provided mail account: > > > > my host is 600host.net > > > my domain is thinkersplayground.com > > > and the email is nore...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > > > I tried adding the code you provided in my environment.rb (I did have > > > it in prodcution.rb) and I now get an error: > > > > ...s/config/environment.rb:13:NameError: uninitialized constant > > > ActionMailer > > > Try moving all that ActionMailer lines to the end of the file (after > > the RailsInitializer.run block is over). > > > David > > > -- > > David A. Black / Ruby Power and Light, LLC > > Ruby/Rails consulting & training:http://www.rubypal.com > > Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) > > >http://www.wishsight.com=> Independent, social wishlist management!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
If I change :address => ''127.0.0.1'' and :port => 25, I get error message: OpenSSL::SSL::SSLError: hostname was not match with the server certificate If I set it to :port => 465 I get a timeout error. any ideas? On 19 Jan, 16:02, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote:> According to my host''s setup instructions: > > Mail Server Username: noreply+thinkersplayground.com > Outgoing Mail Server: mail.thinkersplayground.com (server requires > authentication) port 25 > Outgoing Mail Server: (SSL) server.600host.net (server requires > authentication) port 465 > Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) > > If actionmailer requires SSL then does that mean I need to set smtp > settings to: > :address => "server.600host.net", > :port => 465, > :domain => "thinkersplayground.com", > :authentication => :login, > :user_name => "noreply+thinkersplayground.com", > :password => "password" > > ? > > On 19 Jan, 15:43, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote: > > > Thanks David > > > I''ve moved the code to the bottom of the file and that seems to have > > solved the recent error. > > > Still have the error: > > SocketError: getaddrinfo: Name or service not known > > When trying to send mail though, any thoughts? > > > Im a noob when it comes to SSL etc, is it possible this error is > > simply because my smtp settings are wrong? > > > On 19 Jan, 15:32, "David A. Black" <dbl...-0o/XNnkTkwhBDgjK7y7TUQ@public.gmane.org> wrote: > > > > Hi -- > > > > On Mon, 19 Jan 2009, Dr_Gavin wrote: > > > > > Hi - > > > > It''s a host provided mail account: > > > > > my host is 600host.net > > > > my domain is thinkersplayground.com > > > > and the email is nore...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > > > > I tried adding the code you provided in my environment.rb (I did have > > > > it in prodcution.rb) and I now get an error: > > > > > ...s/config/environment.rb:13:NameError: uninitialized constant > > > > ActionMailer > > > > Try moving all that ActionMailer lines to the end of the file (after > > > the RailsInitializer.run block is over). > > > > David > > > > -- > > > David A. Black / Ruby Power and Light, LLC > > > Ruby/Rails consulting & training:http://www.rubypal.com > > > Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) > > > >http://www.wishsight.com=> Independent, social wishlist management!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Agustin Nicolas Viñao Laseras
2009-Jan-19 16:29 UTC
Re: Still cant get ActionMailer to work!
your host service provide the port to connect to the mail with ssl. Your need to ask them what port do you need to setup. On Mon, Jan 19, 2009 at 2:12 PM, Dr_Gavin <gavin-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org>wrote:> > If I change :address => ''127.0.0.1'' and :port => 25, I get error > message: > > OpenSSL::SSL::SSLError: hostname was not match with the server > certificate > > If I set it to :port => 465 I get a timeout error. > > any ideas? > > > On 19 Jan, 16:02, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote: > > According to my host''s setup instructions: > > > > Mail Server Username: noreply+thinkersplayground.com > > Outgoing Mail Server: mail.thinkersplayground.com (server requires > > authentication) port 25 > > Outgoing Mail Server: (SSL) server.600host.net (server requires > > authentication) port 465 > > Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) > > > > If actionmailer requires SSL then does that mean I need to set smtp > > settings to: > > :address => "server.600host.net", > > :port => 465, > > :domain => "thinkersplayground.com", > > :authentication => :login, > > :user_name => "noreply+thinkersplayground.com", > > :password => "password" > > > > ? > > > > On 19 Jan, 15:43, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote: > > > > > Thanks David > > > > > I''ve moved the code to the bottom of the file and that seems to have > > > solved the recent error. > > > > > Still have the error: > > > SocketError: getaddrinfo: Name or service not known > > > When trying to send mail though, any thoughts? > > > > > Im a noob when it comes to SSL etc, is it possible this error is > > > simply because my smtp settings are wrong? > > > > > On 19 Jan, 15:32, "David A. Black" <dbl...-0o/XNnkTkwhBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > > Hi -- > > > > > > On Mon, 19 Jan 2009, Dr_Gavin wrote: > > > > > > > Hi - > > > > > It''s a host provided mail account: > > > > > > > my host is 600host.net > > > > > my domain is thinkersplayground.com > > > > > and the email is nore...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > > > > > > I tried adding the code you provided in my environment.rb (I did > have > > > > > it in prodcution.rb) and I now get an error: > > > > > > > ...s/config/environment.rb:13:NameError: uninitialized constant > > > > > ActionMailer > > > > > > Try moving all that ActionMailer lines to the end of the file (after > > > > the RailsInitializer.run block is over). > > > > > > David > > > > > > -- > > > > David A. Black / Ruby Power and Light, LLC > > > > Ruby/Rails consulting & training:http://www.rubypal.com > > > > Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2 > ) > > > > > >http://www.wishsight.com=> Independent, social wishlist management! > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
This may seem like a real nooby question but it just occurred to me now, do I need to buy an SSL certificate before I can use actionmailer? :S On 19 Jan, 16:12, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote:> If I change :address => ''127.0.0.1'' and :port => 25, I get error > message: > > OpenSSL::SSL::SSLError: hostname was not match with the server > certificate > > If I set it to :port => 465 I get a timeout error. > > any ideas? > > On 19 Jan, 16:02, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote: > > > According to my host''s setup instructions: > > > Mail Server Username: noreply+thinkersplayground.com > > Outgoing Mail Server: mail.thinkersplayground.com (server requires > > authentication) port 25 > > Outgoing Mail Server: (SSL) server.600host.net (server requires > > authentication) port 465 > > Supported Outgoing Mail Protocols: SMTP, SMTPS (SSL/TLS) > > > If actionmailer requires SSL then does that mean I need to set smtp > > settings to: > > :address => "server.600host.net", > > :port => 465, > > :domain => "thinkersplayground.com", > > :authentication => :login, > > :user_name => "noreply+thinkersplayground.com", > > :password => "password" > > > ? > > > On 19 Jan, 15:43, Dr_Gavin <ga...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org> wrote: > > > > Thanks David > > > > I''ve moved the code to the bottom of the file and that seems to have > > > solved the recent error. > > > > Still have the error: > > > SocketError: getaddrinfo: Name or service not known > > > When trying to send mail though, any thoughts? > > > > Im a noob when it comes to SSL etc, is it possible this error is > > > simply because my smtp settings are wrong? > > > > On 19 Jan, 15:32, "David A. Black" <dbl...-0o/XNnkTkwhBDgjK7y7TUQ@public.gmane.org> wrote: > > > > > Hi -- > > > > > On Mon, 19 Jan 2009, Dr_Gavin wrote: > > > > > > Hi - > > > > > It''s a host provided mail account: > > > > > > my host is 600host.net > > > > > my domain is thinkersplayground.com > > > > > and the email is nore...-YMj/zd8x6QpKMzDMP321V2ksYUyLi9NM@public.gmane.org > > > > > > I tried adding the code you provided in my environment.rb (I did have > > > > > it in prodcution.rb) and I now get an error: > > > > > > ...s/config/environment.rb:13:NameError: uninitialized constant > > > > > ActionMailer > > > > > Try moving all that ActionMailer lines to the end of the file (after > > > > the RailsInitializer.run block is over). > > > > > David > > > > > -- > > > > David A. Black / Ruby Power and Light, LLC > > > > Ruby/Rails consulting & training:http://www.rubypal.com > > > > Coming in 2009: The Well-Grounded Rubyist (http://manning.com/black2) > > > > >http://www.wishsight.com=> Independent, social wishlist management!--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---