Hi, Has anyone got any good tutorials on how to send emails in ruby, seems a bit more complicted than PHP Thanks Scott -- Posted via http://www.ruby-forum.com/.
Please see the Wiki or API or search Google for ActionMailer On 6/12/06, scott <scott@na.com> wrote:> Hi, > > Has anyone got any good tutorials on how to send emails in ruby, seems a > bit more complicted than PHP > > Thanks > Scott > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Just use ruby standart Net::SMTP library. -- Posted via http://www.ruby-forum.com/.
scott wrote:> Hi, > > Has anyone got any good tutorials on how to send emails in ruby, seems a > bit more complicted than PHPRails has ActionMailer, but that''s not part of Ruby. See: http://rubyonrails.org/api/classes/ActionMailer/Base.html Warren -- Posted via http://www.ruby-forum.com/.
Hi, I want users of my application to send emails using a feedback form to other users of my application. I don''t want to publish their email addresses, but I have them in my application. I have an ActionMailer model class called contact.rb. My problem is that I don''t know how to set up the Contact form so that it can send information directly to the controller that then emails the information, by sending it to the ActionMailer. I have found some examples, but they seem complex and all the examples sends the email using a view. Can someone please give an example? Your help will be appreciated. -- Posted via http://www.ruby-forum.com/.
A quick google is all you need: http://wiki.rubyonrails.org/rails/pages/ActionMailer http://api.rubyonrails.org/classes/ActionMailer/Base.html Or buy one of the Rails books. -Jonathan. On 6/25/06, David Smit <davidsmit@gmail.com> wrote:> Hi, > > I want users of my application to send emails using a feedback form to > other users of my application. I don''t want to publish their email > addresses, but I have them in my application. > > I have an ActionMailer model class called contact.rb. My problem is that > I don''t know how to set up the Contact form so that it can send > information directly to the controller that then emails the information, > by sending it to the ActionMailer. I have found some examples, but they > seem complex and all the examples sends the email using a view. > > Can someone please give an example? > > Your help will be appreciated. > > > -- > Posted via http://www.ruby-forum.com/. > _______________________________________________ > Rails mailing list > Rails@lists.rubyonrails.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Jonathan Viney wrote:> A quick google is all you need: > > http://wiki.rubyonrails.org/rails/pages/ActionMailer > http://api.rubyonrails.org/classes/ActionMailer/Base.html > > Or buy one of the Rails books. > > -Jonathan.I have looked at both those sites, before I posted to the forum. The problem I am having is passing the information from the email feedback form to the controller and then sending the information in an email. At the moment I can''t seem to be able to pass the info to the controller. -- Posted via http://www.ruby-forum.com/.
The data from the form gets passed to the action in params. As well as the data from params, you can pass anything to the mailer. class MyController def my_action MyMailer.deliver_message(params[:text], :subject => ''My email'') end end Your mailer could be... class MyMailer < ActionMailer::Base def message(text, options = {}) # set subject, recipients, etc... see one of the examples end end You say you can''t pass data from the form on the page to the controller? That problem is unrelated to sending the email. Look for some examples of submitting forms (any Rails tutorial). -Jonathan. On 6/26/06, David Smit <davidsmit@gmail.com> wrote:> I have looked at both those sites, before I posted to the forum. The > problem I am having is passing the information from the email feedback > form to the controller and then sending the information in an email. At > the moment I can''t seem to be able to pass the info to the controller. >