On 21 Jun 2009, at 17:24, "Älphä Blüë" <rails-mailing-l...@andreas- 
s.net> wrote:

>
> Controller =
>
>  def send_mail
>    @name = params[:name]
>    @subject = params[:subject]
>    @body = params[:body]
>    @address = params[:address]
>

The controller and the mailer are different objects - you can't set  
instance variables in one and expect them to appear in the other. Pass  
what you need as arguments to your mailer

Fred
> Mailer.deliver_notifications(params[:email])
>    flash[:notice] = "Email was succesfully sent."
>    redirect_to :action => "index"
>  end
>
> ====================================================
> Model =
>
>  def notifications(sent_at = Time.now)
>    subject    @subject #params[:subject]
>    recipients 'webmas...@ncaastatpages.com'
>    from       @address #params[:address]
>    sent_on    sent_at
>    body       :greeting => @body #params[:body], :sender_name =>
> params[:name]
>  end
>
> ====================================================
> Mapping =
>
>  map.contact '/contact', :controller => 'contact', :action => 'index'
>  map.send_mail '/contact', :controller => 'contact', :action =>
> 'send_mail'
>
> ====================================================
>
> I'm able to use the form but receive no flash messages, the form  
> clears
> out, and no mail is received (it should work in development right?)
>
> Again, I'm new to mail so just trying to understand this all.
> -- 
> 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@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to