I''m attempting to get email working and I should mention in Development. Generating some errors and hope some one might catch my mistake. Controller call: def register u = User.new(params[:user]) u.save @session[''user''] = u.id RegMailer.deliver_greeting(u) # this is the line that''s throwing the error - redirect_to :controller => "main", :action => "welcome" Here is the error: undefined local variable or method `user'' for #<RegMailer:0x36c2f58> RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace #{RAILS_ROOT}/app/models/reg_mailer.rb:14:in `greeting'' #{RAILS_ROOT}/app/controllers/main_controller.rb:7:in `register'' Here is the mailer: class RegMailer < ActionMailer::Base def greeting(sent_at = Time.now) @subject = ''Thank you for registering'' @body["first_name"]= user.first_name @recipients["email"] = user.email @from = ''lurkkcom-VmThZoX2DAXkRz0MatEQw9BPR1lH4CV8@public.gmane.org'' @sent_on = sent_at end end Here is the view: Dear <%= @u.first_name %> Thank you for signing up at our webiste. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
> RegMailer.deliver_greeting(u) # this is the line that''s> class RegMailer < ActionMailer::Base > def greeting(sent_at = Time.now) > @subject = ''Thank you for registering'' > @body["first_name"]= user.first_name > @recipients["email"] = user.email...> Here is the error: > undefined local variable or method `user'' for #<RegMailer:0x36c2f58>I believe the user method you put in the class RegMailer is not really defined for that class, (unlesss you defined this elsewhere?), and so you are getting the ''undefined user...'' when you do deliver_greeting(arg), did you pass the (arg) in the def greeting...? it can''t find the ''user'' method, because that argument was not passed to it. try modifying the greeting method to something like: def greeting(user) @subject = ''Thank you for registering'' @body["first_name"]= user.first_name @recipients["email"] = user.email ... and see if it''ll work... harp -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
>I''m attempting to get email working and I should mention in Development....i also believe ActionMailer works only in production mode, and if you need to check mistakes, go to the log file..? is any of this helping? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I''m not even sure why the argument to def greeting is "sent_at = Time.now" I went along with the same from AWDWR. Where in just setting up an email in Ruby and ActionMailer I sent mail using def simple_message(recipient) which seemed to work. Stuart On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:>> > > class RegMailer < ActionMailer::Base > > def greeting(sent_at = Time.now) > > @subject = ''Thank you for registering'' > > @body["first_name"]= user.first_name > > @recipients["email"] = user.email > ... > > > Here is the error: > > undefined local variable or method `user'' for #<RegMailer:0x36c2f58> > > I believe the user method you put in the class RegMailer is not really > defined for that class, (unlesss you defined this elsewhere?), and so > you are getting the ''undefined user...''> > when you do deliver_greeting(arg), did you pass the (arg) in the def > greeting...? it can''t find the ''user'' method, because that argument was > not passed to it. > > try modifying the greeting method to something like: > > def greeting(user) > @subject = ''Thank you for registering'' > @body["first_name"]= user.first_name > @recipients["email"] = user.email > ... > > and see if it''ll work... > > harp > > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hmmm....still aggrevating me with a new error: "NoMethodError in MainController#register You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[]=" Here is the mailer def greeting(user) @subject = ''Thank you for registering'' @body["first_name"]= user.first_name @recipients["email"] = user.email @from = ''****@*****.com'' @sent_on = sent_at end and the action : def register u = User.new(params[:user]) u.save @session[''user''] = u.id RegMailer.deliver_greeting(u) <--------------ACTION for Mailer redirect_to :controller => "main", :action => "welcome" end Stuart On 8/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I''m not even sure why the argument to def greeting is "sent_at = Time.now" > I went along with the same from AWDWR. Where in just setting up an > email in Ruby and ActionMailer I sent mail using def > simple_message(recipient) which seemed to work. > > Stuart > > On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > > class RegMailer < ActionMailer::Base > > > def greeting(sent_at = Time.now) > > > @subject = ''Thank you for registering'' > > > @body["first_name"]= user.first_name > > > @recipients["email"] = user.email > > ... > > > > > Here is the error: > > > undefined local variable or method `user'' for #<RegMailer:0x36c2f58> > > > > I believe the user method you put in the class RegMailer is not really > > defined for that class, (unlesss you defined this elsewhere?), and so > > you are getting the ''undefined user...'' > > > > > when you do deliver_greeting(arg), did you pass the (arg) in the def > > greeting...? it can''t find the ''user'' method, because that argument was > > not passed to it. > > > > try modifying the greeting method to something like: > > > > def greeting(user) > > @subject = ''Thank you for registering'' > > @body["first_name"]= user.first_name > > @recipients["email"] = user.email > > ... > > > > and see if it''ll work... > > > > harp > > > > > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I think I''m almost there but down it''s bombing on : SocketError in MainController#register getaddrinfo: no address associated with hostname. Everything seems to be in order From config/environments/development.rb: # Base delivery ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.server_settings = { :address => "mail.******.com", :port => 25, :domain => "*****.com", :authentication => :login, :user_name => "**********", :password => "**********" } ActionMailer::Base.default_charset = "utf-8" These are the correct settings for my smtp server (minus what''s blanked by asterix) Stuart On 8/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hmmm....still aggrevating me with a new error: > > "NoMethodError in MainController#register > You have a nil object when you didn''t expect it! > You might have expected an instance of Array. > The error occured while evaluating nil.[]=" > > > Here is the mailer > def greeting(user) > @subject = ''Thank you for registering'' > @body["first_name"]= user.first_name > @recipients["email"] = user.email > @from = ''****@*****.com'' > @sent_on = sent_at > end > > and the action : > def register > u = User.new(params[:user]) > u.save > @session[''user''] = u.id > RegMailer.deliver_greeting(u) <--------------ACTION for Mailer > redirect_to :controller => "main", :action => "welcome" > end > > Stuart > > On 8/23/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I''m not even sure why the argument to def greeting is "sent_at = Time.now" > > I went along with the same from AWDWR. Where in just setting up an > > email in Ruby and ActionMailer I sent mail using def > > simple_message(recipient) which seemed to work. > > > > Stuart > > > > On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > > > > > > class RegMailer < ActionMailer::Base > > > > def greeting(sent_at = Time.now) > > > > @subject = ''Thank you for registering'' > > > > @body["first_name"]= user.first_name > > > > @recipients["email"] = user.email > > > ... > > > > > > > Here is the error: > > > > undefined local variable or method `user'' for #<RegMailer:0x36c2f58> > > > > > > I believe the user method you put in the class RegMailer is not really > > > defined for that class, (unlesss you defined this elsewhere?), and so > > > you are getting the ''undefined user...'' > > > > > > > > when you do deliver_greeting(arg), did you pass the (arg) in the def > > > greeting...? it can''t find the ''user'' method, because that argument was > > > not passed to it. > > > > > > try modifying the greeting method to something like: > > > > > > def greeting(user) > > > @subject = ''Thank you for registering'' > > > @body["first_name"]= user.first_name > > > @recipients["email"] = user.email > > > ... > > > > > > and see if it''ll work... > > > > > > harp > > > > > > > > > > > > -- > > > Posted via http://www.ruby-forum.com/. > > > > > > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> ...i also believe ActionMailer works only in production mode, and if you > need to check mistakes, go to the log file..? > > is any of this helping? > > --I don''t know if that''s true, from what I read you configure in the development config file and then should be allowed to send my mail through and SMTP server. I''ve done it via regular Ruby program with ActionMailer not sure why Rails would be any different. Right now I''m still getting : getaddrinfo: no address associated with hostname. Anyone have any ideas why ? Everything looks fine in the config file. Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Fellowes wrote:> On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > >> ...i also believe ActionMailer works only in production mode, and if you >> need to check mistakes, go to the log file..? >> >> is any of this helping? >> >> -- > I don''t know if that''s true, from what I read you configure in the > development config file and then should be allowed to send my mail > through and SMTP server. I''ve done it via regular Ruby program with > ActionMailer not sure why Rails would be any different. > > Right now I''m still getting : > getaddrinfo: no address associated with hostname. > > Anyone have any ideas why ? Everything looks fine in the config file. > > StuartActionMailer works in Dev mode - no problem! I configure it in Environment.rb so not what happens if you put the settings in development.rb as you mention above. Regardless, I had a heck of a time getting mine setup originally and it took a few combination of settings before it worked. For me, I commented out the domain setting and that did the trick. For my ISP host, I had to change the port number to 80 from 25 (I''m relaying). Try that and see if it helps. All the other errors you mention had nothing to do with actionmailer! Regards, Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks Michael, I''ll play around with the settings as you suggest. I still wonder if something else within Rails is causing the issue. My Ruby email program has the same settings as the environment.rb in Rails, except that from what I see Rails uses double quotes, and the Ruby has single quotes around the parameter. Didn''t seem to matter much though. Stuart On 8/23/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Stuart Fellowes wrote: > > On 8/23/06, harper <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > >> ...i also believe ActionMailer works only in production mode, and if you > >> need to check mistakes, go to the log file..? > >> > >> is any of this helping? > >> > >> -- > > I don''t know if that''s true, from what I read you configure in the > > development config file and then should be allowed to send my mail > > through and SMTP server. I''ve done it via regular Ruby program with > > ActionMailer not sure why Rails would be any different. > > > > Right now I''m still getting : > > getaddrinfo: no address associated with hostname. > > > > Anyone have any ideas why ? Everything looks fine in the config file. > > > > Stuart > > ActionMailer works in Dev mode - no problem! I configure it in > Environment.rb so not what happens if you put the settings in > development.rb as you mention above. > > Regardless, I had a heck of a time getting mine setup originally and it > took a few combination of settings before it worked. For me, I > commented out the domain setting and that did the trick. For my ISP > host, I had to change the port number to 80 from 25 (I''m relaying). > > Try that and see if it helps. All the other errors you mention had > nothing to do with actionmailer! > > Regards, > > Michael > > > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Fellowes wrote:> Thanks Michael, > I''ll play around with the settings as you suggest. > I still wonder if something else within Rails is causing the issue. > My Ruby email program has the same settings as the environment.rb in > Rails, except that from what I see Rails uses double quotes, and the > Ruby has single quotes around the parameter. Didn''t seem to matter > much though. > > StuartStuart - one more thing to think about... mail.XXX.com may be your incoming server name - not the outgoing server name. Mine is smtpout.XXX.com. Maybe this isn''t the case since you have it working elsewhere but just a thought. Regards, Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/23/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Stuart - one more thing to think about... mail.XXX.com may be your > incoming server name - not the outgoing server name. Mine is > smtpout.XXX.com. Maybe this isn''t the case since you have it working > elsewhere but just a thought. > > Regards, > > MichaelI just got back to working on this and did a registration to test. This time the getaddrinfo error wasn''t thrown, but I haven''t seen an email come through either. I opened the development log and saw this: Sent mail: From: me-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org To: user.email Subject: Thank you for registering Content-Type: text/plain; charset=utf-8 I''m wondering if the To: user.email is wrong, meaning shouldn''t it reflect the actual address ? Perhaps someone can take a look at the code and tell me if they see anything wrong? At this point I''m not getting any errors or exceptions thrown. MainController: def register u = User.new(params[:user]) u.save @session[''user''] = u.id RegMailer.deliver_greeting(u) redirect_to :controller => "main", :action => "welcome" end Mailer: def greeting(user) @subject = ''Thank you for registering'' @body = ''user.first_name'' @recipients = ''user.email'' @from = me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' end MailerView: Dear <%= @u.first_name %> Thank you for signing up at our webiste. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Haven''t seen a reply come through so I''m throwing this out again. Not sure what the code issues are but I want to send an email when a new user registers. I''m capturing their information in the variable u and that works for database entry. Problem is passing it over to the mailer. I''m guess becuase u is a local it''s not making it across to the mailer. From the log the email is working but it says it went to user-zuv13RyHHZlfmgfxC/sS/w@public.gmane.org :) Would like some suggestions maybe.> > MainController: > def register > u = User.new(params[:user]) > u.save > @session[''user''] = u.id > RegMailer.deliver_greeting(u) > redirect_to :controller => "main", :action => "welcome" > end > > Mailer: > def greeting(user) > @subject = ''Thank you for registering'' > @body = ''user.first_name'' > @recipients = ''user.email'' > @from = me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > end > > MailerView: > Dear <%= @u.first_name %> > Thank you for signing up at our webiste. >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart Fellowes wrote:> Haven''t seen a reply come through so I''m throwing this out again. > Not sure what the code issues are but I want to send an email when a > new user registers. > I''m capturing their information in the variable u and that works for > database entry. Problem is passing it over to the mailer. I''m guess > becuase u is a local it''s not making it across to the mailer. From > the log the email is working but it says it went to user-zuv13RyHHZlfmgfxC/sS/w@public.gmane.org :) > > Would like some suggestions maybe.Hi Stuart, It''s sending it exactly to the location you asked for! Take out the single quotes around user.email and you should be good to go! Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Michael Modica wrote:> Stuart Fellowes wrote: >> Haven''t seen a reply come through so I''m throwing this out again. >> Not sure what the code issues are but I want to send an email when a >> new user registers. >> I''m capturing their information in the variable u and that works for >> database entry. Problem is passing it over to the mailer. I''m guess >> becuase u is a local it''s not making it across to the mailer. From >> the log the email is working but it says it went to user-zuv13RyHHZlfmgfxC/sS/w@public.gmane.org :) >> >> Would like some suggestions maybe. > > Hi Stuart, > > It''s sending it exactly to the location you asked for! Take out the > single quotes around user.email and you should be good to go! > > MichaelActually - you have a few syntax issues in the code you pasted! user.first_name instead of ''user.first_name'' user.email instead of ''user.email'' and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' Michael -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > Hi Stuart, > > > > It''s sending it exactly to the location you asked for! Take out the > > single quotes around user.email and you should be good to go! > > > > Michael > > Actually - you have a few syntax issues in the code you pasted! > > user.first_name instead of ''user.first_name'' > user.email instead of ''user.email'' > and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org > > ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > > Michael >I made all the syntax corrections and now the development log shows it''s being sent to the correct email address. Still no email is coming through and so now I''m wondering if it''s a configuration issue with ActionMailer. I believe that in order to actually use mailers in development mode you make all the specific configurations in config/environments/development.rb which I''ve done. I went ahead to make sure that i could connect to my remote smtp server via a Ruby program. Again the Ruby program sends the mail (and it''s using ActionMailer). Rails though is not sending the email ? Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > Hi Stuart, > > > > > > It''s sending it exactly to the location you asked for! Take out the > > > single quotes around user.email and you should be good to go! > > > > > > Michael > > > > Actually - you have a few syntax issues in the code you pasted! > > > > user.first_name instead of ''user.first_name'' > > user.email instead of ''user.email'' > > and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org > > > > ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > > > > Michael > > > > I made all the syntax corrections and now the development log shows > it''s being sent to the correct email address. Still no email is coming > through and so now I''m wondering if it''s a configuration issue with > ActionMailer. I believe that in order to actually use mailers in > development mode you make all the specific configurations in > config/environments/development.rb which I''ve done. I went ahead to > make sure that i could connect to my remote smtp server via a Ruby > program. Again the Ruby program sends the mail (and it''s using > ActionMailer). Rails though is not sending the email ? > > Stuart >I also want to add that I put the configuration in environment.rb as well. Still no change. Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > Hi Stuart, > > > > > > > > It''s sending it exactly to the location you asked for! Take out the > > > > single quotes around user.email and you should be good to go! > > > > > > > > Michael > > > > > > Actually - you have a few syntax issues in the code you pasted! > > > > > > user.first_name instead of ''user.first_name'' > > > user.email instead of ''user.email'' > > > and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org > > > > > > ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > > > > > > Michael > > > > > > > I made all the syntax corrections and now the development log shows > > it''s being sent to the correct email address. Still no email is coming > > through and so now I''m wondering if it''s a configuration issue with > > ActionMailer. I believe that in order to actually use mailers in > > development mode you make all the specific configurations in > > config/environments/development.rb which I''ve done. I went ahead to > > make sure that i could connect to my remote smtp server via a Ruby > > program. Again the Ruby program sends the mail (and it''s using > > ActionMailer). Rails though is not sending the email ? > > > > Stuart > > > I also want to add that I put the configuration in environment.rb as > well. Still no change. > Stuart >One more thing : I''ve set the following line (instead of default) config.action_mailer.raise_delivery_errors = true and not seeing any errors in dev log. Stuart --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
bump! sorry this is driving me nuts, development log say mail is sending ,but the mail is not coming through. Just to review here I''ve set ActionMailer configuration options in config/environments/development.rb. # I want to see errors raised config.action_mailer.raise_delivery_errors = true # Base delivery ActionMailer::Base.delivery_method = :smtp ActionMailer::Base.server_settings = { :address => "mail.mydomain.com", :port => 25, :domain => "mydomain.com", :user_name => "myusername", :password => "mypassword", :authentication => :login } ActionMailer::Base.default_charset = "utf-8" Just to show what''s in the dev log: [4;35;1mSQL (0.078000) COMMIT Sent mail: From: mailadmin-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org To: correctname-/E1597aS9LQAvxtiuMwx3w@public.gmane.org Subject: Thank you for registering Content-Type: text/plain; charset=utf-8 I changed the username and domain name but in the log it''s correct. I''ve gone through the environment.rb file to make sure nothing was configured there for ActionMailer and even went and configured it. Man this is weird. Stuart On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > > Hi Stuart, > > > > > > > > > > It''s sending it exactly to the location you asked for! Take out the > > > > > single quotes around user.email and you should be good to go! > > > > > > > > > > Michael > > > > > > > > Actually - you have a few syntax issues in the code you pasted! > > > > > > > > user.first_name instead of ''user.first_name'' > > > > user.email instead of ''user.email'' > > > > and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org > > > > > > > > ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > > > > > > > > Michael > > > > > > > > > > I made all the syntax corrections and now the development log shows > > > it''s being sent to the correct email address. Still no email is coming > > > through and so now I''m wondering if it''s a configuration issue with > > > ActionMailer. I believe that in order to actually use mailers in > > > development mode you make all the specific configurations in > > > config/environments/development.rb which I''ve done. I went ahead to > > > make sure that i could connect to my remote smtp server via a Ruby > > > program. Again the Ruby program sends the mail (and it''s using > > > ActionMailer). Rails though is not sending the email ? > > > > > > Stuart > > > > > I also want to add that I put the configuration in environment.rb as > > well. Still no change. > > Stuart > > > One more thing : > I''ve set the following line (instead of default) > config.action_mailer.raise_delivery_errors = true > and not seeing any errors in dev log. > > Stuart >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Wait here is something weird! I started thinking maybe something is wrong with the local server (webrick) and considered trying mongrel. However instead of loading up the app in firefox via webrick and just run it in RadRails under port 3003. Trying to register 3 x I get recognition errors. Very odd since things were working right before. 4th time registration succeeds and the email goes through. So it''s got to be something in my browser (only thing I can think of). Though I''m not entirely sure what browser RadRails is using. Then there is the weirdness of the browser inside RadRails giving me routing errors (recognition). Oiiiiiiiiiiiii! Stuart On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> bump! sorry this is driving me nuts, development log say mail is > sending ,but the mail is not coming through. > Just to review here I''ve set ActionMailer configuration options in > config/environments/development.rb. > > # I want to see errors raised > config.action_mailer.raise_delivery_errors = true > > # Base delivery > ActionMailer::Base.delivery_method = :smtp > > ActionMailer::Base.server_settings = { > :address => "mail.mydomain.com", > :port => 25, > :domain => "mydomain.com", > :user_name => "myusername", > :password => "mypassword", > :authentication => :login } > > ActionMailer::Base.default_charset = "utf-8" > > Just to show what''s in the dev log: > > [4;35;1mSQL (0.078000) COMMIT > Sent mail: > From: mailadmin-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org > To: correctname-/E1597aS9LQAvxtiuMwx3w@public.gmane.org > Subject: Thank you for registering > Content-Type: text/plain; charset=utf-8 > > I changed the username and domain name but in the log it''s correct. > I''ve gone through the environment.rb file to make sure nothing was > configured there for ActionMailer and even went and configured it. > > Man this is weird. > Stuart > > > On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > > > > > > > Hi Stuart, > > > > > > > > > > > > It''s sending it exactly to the location you asked for! Take out the > > > > > > single quotes around user.email and you should be good to go! > > > > > > > > > > > > Michael > > > > > > > > > > Actually - you have a few syntax issues in the code you pasted! > > > > > > > > > > user.first_name instead of ''user.first_name'' > > > > > user.email instead of ''user.email'' > > > > > and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org > > > > > > > > > > ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' > > > > > > > > > > Michael > > > > > > > > > > > > > I made all the syntax corrections and now the development log shows > > > > it''s being sent to the correct email address. Still no email is coming > > > > through and so now I''m wondering if it''s a configuration issue with > > > > ActionMailer. I believe that in order to actually use mailers in > > > > development mode you make all the specific configurations in > > > > config/environments/development.rb which I''ve done. I went ahead to > > > > make sure that i could connect to my remote smtp server via a Ruby > > > > program. Again the Ruby program sends the mail (and it''s using > > > > ActionMailer). Rails though is not sending the email ? > > > > > > > > Stuart > > > > > > > I also want to add that I put the configuration in environment.rb as > > > well. Still no change. > > > Stuart > > > > > One more thing : > > I''ve set the following line (instead of default) > > config.action_mailer.raise_delivery_errors = true > > and not seeing any errors in dev log. > > > > Stuart > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Stuart, What do you get in the console? script/console RegMailer.deliver_greeting( User.find_by_id( your_id ) ) If you get something like #<TMail::Mail port=#<TMail::StringPort:id=0x11b3e3e> bodyport=#<TMail::StringPort:id=0x11b2462>> then it''s most likely something outside of your app. I''m thinking your ISP doesn''t allow that sort of traffic. If that''s the problem, you can get around it if your host allows mail to be sent on an alternate port (!= 25). I know Dreamhost allows that sort of shenanigans. On Aug 25, 2006, at 9:51 AM, Dark Ambient wrote:> > Wait here is something weird! I started thinking maybe something is > wrong with the local server (webrick) and considered trying mongrel. > However instead of loading up the app in firefox via webrick and just > run it in RadRails under port 3003. Trying to register 3 x I get > recognition errors. Very odd since things were working right before. > 4th time registration succeeds and the email goes through. > > So it''s got to be something in my browser (only thing I can think of). > Though I''m not entirely sure what browser RadRails is using. Then > there is the weirdness of the browser inside RadRails giving me > routing errors (recognition). > > Oiiiiiiiiiiiii! > Stuart > > On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> bump! sorry this is driving me nuts, development log say mail is >> sending ,but the mail is not coming through. >> Just to review here I''ve set ActionMailer configuration options in >> config/environments/development.rb. >> >> # I want to see errors raised >> config.action_mailer.raise_delivery_errors = true >> >> # Base delivery >> ActionMailer::Base.delivery_method = :smtp >> >> ActionMailer::Base.server_settings = { >> :address => "mail.mydomain.com", >> :port => 25, >> :domain => "mydomain.com", >> :user_name => "myusername", >> :password => "mypassword", >> :authentication => :login } >> >> ActionMailer::Base.default_charset = "utf-8" >> >> Just to show what''s in the dev log: >> >> [4;35;1mSQL (0.078000) COMMIT >> Sent mail: >> From: mailadmin-3Q2Tfjf0mexWk0Htik3J/w@public.gmane.org >> To: correctname-/E1597aS9LQAvxtiuMwx3w@public.gmane.org >> Subject: Thank you for registering >> Content-Type: text/plain; charset=utf-8 >> >> I changed the username and domain name but in the log it''s correct. >> I''ve gone through the environment.rb file to make sure nothing was >> configured there for ActionMailer and even went and configured it. >> >> Man this is weird. >> Stuart >> >> >> On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>> On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>> On 8/25/06, Dark Ambient <sambient-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >>>>> On 8/24/06, Michael Modica <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> >>>>> wrote: >>>>> >>>>>>> Hi Stuart, >>>>>>> >>>>>>> It''s sending it exactly to the location you asked for! Take >>>>>>> out the >>>>>>> single quotes around user.email and you should be good to go! >>>>>>> >>>>>>> Michael >>>>>> >>>>>> Actually - you have a few syntax issues in the code you pasted! >>>>>> >>>>>> user.first_name instead of ''user.first_name'' >>>>>> user.email instead of ''user.email'' >>>>>> and add a single quote in front of me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org >>>>>> >>>>>> ''me-NNbln4oHrFpl57MIdRCFDg@public.gmane.org'' >>>>>> >>>>>> Michael >>>>>> >>>>> >>>>> I made all the syntax corrections and now the development log >>>>> shows >>>>> it''s being sent to the correct email address. Still no email is >>>>> coming >>>>> through and so now I''m wondering if it''s a configuration issue >>>>> with >>>>> ActionMailer. I believe that in order to actually use mailers in >>>>> development mode you make all the specific configurations in >>>>> config/environments/development.rb which I''ve done. I went >>>>> ahead to >>>>> make sure that i could connect to my remote smtp server via a Ruby >>>>> program. Again the Ruby program sends the mail (and it''s using >>>>> ActionMailer). Rails though is not sending the email ? >>>>> >>>>> Stuart >>>>> >>>> I also want to add that I put the configuration in >>>> environment.rb as >>>> well. Still no change. >>>> Stuart >>>> >>> One more thing : >>> I''ve set the following line (instead of default) >>> config.action_mailer.raise_delivery_errors = true >>> and not seeing any errors in dev log. >>> >>> Stuart >>> >> > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---