It seems like you should be able to do
AccountMailer.new(params).dispatch_and_deliver(:action, :from => ...)
Do you really need to pass in a second param to AccountMailer.new?
-- Yehuda
On Mon, Oct 6, 2008 at 10:19 PM, contagion <[EMAIL PROTECTED]> wrote:
>
> I am a Rails developer recently trying out merb and found
> Merb::MailController very slick. I really like idea that I could use
> before/after filters and layouts when sending mail.
>
> However, I cannot send email from offline scripts, because send_mail
> needs to be called inside a Controller.
>
> After digging around the source and some experiments, I finally found
> a way to send email from a offline script:
>
> #AccountMailer is a subclass of MailController
> AccountMailer.new({:user => User.first},
> Merb::AbstractController.new).dispatch_and_deliver(:reminder,
> { :from => "[EMAIL PROTECTED]",:to => "[EMAIL PROTECTED]",:subject =>
> "offline!!" })
>
> Hope this is useful for somebody else.
>
>
>
> >
>
--
Yehuda Katz
Developer | Engine Yard
(ph) 718.877.1325
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"merb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/merb?hl=en
-~----------~----~----~----~------~----~------~--~---