Hi all, I need some of my emails to go out using "smtp" and some others using "sendmail" . Is there a clean way to switch between these two deliver methods depending upon the mailer method? Thanks! -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
radhames brito
2010-Sep-09 11:18 UTC
Re: dynamically changing ActionMailer::Base.delivery_method
maybe with a rake task for the send mail one, running with deamon but it will have to load your app and change the config, i think it will get ugly. On Thu, Sep 9, 2010 at 1:47 AM, Ram <yourstruly.vinay-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I need some of my emails to go out using "smtp" and some others using > "sendmail" . Is there a clean way to switch between these two deliver > methods depending upon the mailer method? > > Thanks! > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org<rubyonrails-talk%2Bunsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > . > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Sep-09 11:22 UTC
Re: dynamically changing ActionMailer::Base.delivery_method
On Sep 9, 6:47 am, Ram <yourstruly.vi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi all, > > I need some of my emails to go out using "smtp" and some others using > "sendmail" . Is there a clean way to switch between these two deliver > methods depending upon the mailer method? >I think (but do test this!) that you could do something like class SmtpMailer < AM::Base self.delivery_method = :smtp end class SendmailMailer < AM::Base self.delivery_method = :sendmail end and then derive mailers from those two classes as appropriate. If you have identical mail that needs to be delivered via either of those two mechanisms then it might be a bit more complicated. Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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?hl=en.