Hi. :) I''m working on sending mails issue and I have one question: How can it be possible for my application to be sending emails, without configuring mail server specific parameters (domain name, username, password, etc)? Does anyone have an answer on this? Here is the code in the controller: def send_email Notifier.deliver_signup_notification("recepientmail-O5WfVfzUwx8@public.gmane.org") end And, here it is the class: class Notifier < ActionMailer::Base def signup_notification(myEmail) recipients myEmail subject "Test Subject" body "Test body" from "sendermail-O5WfVfzUwx8@public.gmane.org" content_type "text/html" end end Thanks in advance. Regards, Sase P.S. I am new at this, so excuse me if I''m sending silly questions, but I''m trying to learn how stuff works ;-) -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi, Me again. This code works properly, but I don''t know why :( Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 03 Jul 2007, at 13:34, Sase wrote:> I''m working on sending mails issue and I have one question: > > How can it be possible for my application to be sending emails, > without > configuring mail server specific parameters (domain name, username, > password, etc)? > > Does anyone have an answer on this? > Here is the code in the controller:Because you do need to provide these parameters, but I place them in environment.rb (or a specific production/development environment if they differ). Using Sendmail ActionMailer::Base.delivery_method = :sendmail Or normal SMTP ActionMailer::Base.smtp_settings = { :address => "127.0.0.1", :domain => "mydomain.com", :port => 123456789, :user_name => "myuser", :password => "mypassword", :authentication => :plain/:login/:cram_md5 (whatever you want to use of these three) } Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 Peter, First of all, thanks for the quick reply :))) If understood correctly, I either use :sendmail or SMTP settings. My code worked with config.action_mailer.delivery_method = :smtp in the Rails::Initializer.run block situated in the environment.rb and (as you said) ActionMailer::Base.delivery_method = :sendmail. If I remove these two lines in the environment.rb, that means that I should write SMTP parameters, right? Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
Hi. So now my environment.rb file looks like this (no SMTP, no Sendmail): RAILS_GEM_VERSION = ''1.2.3'' unless defined? RAILS_GEM_VERSION require File.join(File.dirname(__FILE__), ''boot'') Rails::Initializer.run do |config| end But, it STILL sends mails. Is this ok??? Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 03 Jul 2007, at 14:15, Sase wrote:> If understood correctly, I either use :sendmail or SMTP settings.Correct> My code worked with > config.action_mailer.delivery_method = :smtp > in the Rails::Initializer.run block situated in the environment.rb > and (as you said)One of the two notations is the preferred one, don''t remember which one.> ActionMailer::Base.delivery_method = :sendmail.I place this below the Rails::Initializer block.> If I remove these two lines in the environment.rb, that means that I > should write SMTP parameters, right?Probably yeah. Just try it out :-) Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 03 Jul 2007, at 14:33, Sase wrote:> So now my environment.rb file looks like this (no SMTP, no Sendmail): > > RAILS_GEM_VERSION = ''1.2.3'' unless defined? RAILS_GEM_VERSION > require File.join(File.dirname(__FILE__), ''boot'') > Rails::Initializer.run do |config| > end > > But, it STILL sends mails. > Is this ok???Did you restart your mongrel(s)? Environment is loaded at startup. If you don''t want to send mails in development, there''s a parameter in the environment variables for that too. Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Well, I''m using WEBrick, but I''ve restarted it for sure. I really don''t know what''s wrong with this :( Usually, we all want the code to work, but now I don''t want to :)) Can you suggest some tutorial so I can read something meanwhile? I have few tutorials, but anything + is welcomed :) Thanks once again! Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
On 03 Jul 2007, at 14:47, Sase wrote:> Well, I''m using WEBrick, but I''ve restarted it for sure. > I really don''t know what''s wrong with this :( > Usually, we all want the code to work, but now I don''t want to :)) > > Can you suggest some tutorial so I can read something meanwhile? > I have few tutorials, but anything + is welcomed :)Agile Web Development with Rails, Second Edition, buy the PDF version and you''ll have all the info you need a few minutes later. You should also check the wiki (and hope the info isn''t outdated): http:// wiki.rubyonrails.org/rails/pages/ActionMailer Best regards Peter De Berdt --~--~---------~--~----~------------~-------~--~----~ 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 SMTP server is not specified in environment.rb or helper, ActionMailer defaults to localhost''s smtp agent. That''s why the email still gets sent out. There aren''t too many up to date tutorials out there and with ActionMailer, I found too many subtle changes from versions. Good luck! On Jul 3, 8:33 am, Sase <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> Hi. > So now my environment.rb file looks like this (no SMTP, no Sendmail): > > RAILS_GEM_VERSION = ''1.2.3'' unless defined? RAILS_GEM_VERSION > require File.join(File.dirname(__FILE__), ''boot'') > Rails::Initializer.run do |config| > end > > But, it STILL sends mails. > Is this ok??? > > Regards, > Sase > > -- > Posted viahttp://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?hl=en -~----------~----~----~----~------~----~------~--~---
> Agile Web Development with Rails, Second Edition, buy the PDF version > and you''ll have all the info you need a few minutes later. You should > also check the wiki (and hope the info isn''t outdated): http:// > wiki.rubyonrails.org/rails/pages/ActionMailerGreat! Thanks Peter... I''m about to read this book, and if I have any question, I''ll ask you guys... Thanks again! Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
> If SMTP server is not specified in environment.rb or helper, > ActionMailer defaults to localhost''s smtp agent. That''s why the email > still gets sent out. There aren''t too many up to date tutorials out > there and with ActionMailer, I found too many subtle changes from > versions.Ahaaaa... :-) Now I get it ;-) Thanks Joon for your reply! Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---
if you are on textdrive you can send emails without configuring anything. On Jul 4, 11:08 am, Sase <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > If SMTP server is not specified in environment.rb or helper, > > ActionMailer defaults to localhost''s smtp agent. That''s why the email > > still gets sent out. There aren''t too many up to date tutorials out > > there and with ActionMailer, I found too many subtle changes from > > versions. > > Ahaaaa... :-) > Now I get it ;-) > > Thanks Joon for your reply! > > Regards, > Sase > > -- > Posted viahttp://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?hl=en -~----------~----~----~----~------~----~------~--~---
> if you are on textdrive you can send emails without configuring > anything.Hi Hasham, I''m afraid I''m not using textdrive, but still thanks for your concern ;-) I guess I''ll have to stick to the ''ActionMailer defaults to localhost''s smtp agent'' till I read some tutorials and make things clear. Thanks again! Regards, Sase -- 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?hl=en -~----------~----~----~----~------~----~------~--~---