I have written a mailer, when i call: MyMailer.deliver_welcome("Name", "emailaddress-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ) I successfully send an email to the address that i specify. I have written a mail recieving client that lives in MyMailer called recieve. I can successfully recieve mail with it. I am trying to write a "Thanks for the message, we have received it" email that replies back the sender of an email. But this line of code inside of my MyMailer does not work: def receive(email) MyMailer.deliver_welcome("Name", "emailaddress-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ) end Both pieces of code work great separately, but when i try to call the deliver_welcome method from within the ActionMailer model i created, for some reason it never executes or never executes-properly. Rails 2.2.2, Ruby 1.8.6, any insight would be tremendously helpful! -- 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 -~----------~----~----~----~------~----~------~--~---
rubyguy-DaQTI0RpDDMAvxtiuMwx3w@public.gmane.org
2009-Mar-21 08:40 UTC
Re: Sending & Recieving Mail
On 21 Mar., 06:01, Richard Schneeman <rails-mailing-l...@andreas- s.net> wrote:> I have written a mailer, when i call: > > MyMailer.deliver_welcome("Name", "emailaddr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ) > > I successfully send an email to the address that i specify. > > I have written a mail recieving client that lives in MyMailer called > recieve. I can successfully recieve mail with it. > > I am trying to write a "Thanks for the message, we have received it" > email that replies back the sender of an email. But this line of code > inside of my MyMailer does not work: > > def receive(email) > MyMailer.deliver_welcome("Name", "emailaddr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ) > end > > Both pieces of code work great separately, but when i try to call the > deliver_welcome method from within the ActionMailer model i created, for > some reason it never executes or never executes-properly. > > Rails 2.2.2, Ruby 1.8.6, any insight would be tremendously helpful!This is just a wild guess, but did you try to call the method like this instead? def receive(email) deliver_welcome("Name", "emailaddr...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" ) end -- Cheers, David Knorr http://twitter.com/rubyguy --~--~---------~--~----~------------~-------~--~----~ 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@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
I''ve tried that, it doesn''t work. I was successfully able to find a workaround using an observer, but i would still think that this type of action Should be possible. -- 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 -~----------~----~----~----~------~----~------~--~---
rubyguy-DaQTI0RpDDMAvxtiuMwx3w@public.gmane.org
2009-Mar-22 12:21 UTC
Re: Sending & Recieving Mail
On 22 Mar., 04:55, Richard Schneeman <rails-mailing-l...@andreas- s.net> wrote:> I''ve tried that, it doesn''t work. I was successfully able to find a > workaround using an observer, but i would still think that this type of > action Should be possible.I think so too. Did you check your log to see if ActionMailer puts anything there? -- Best regards, David Knorr http://twitter.com/rubyguy --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Strange, i was abandoning the idea altogether, but went back changed my code to give you the output you asked for, and poof...it worked. No clue what changed. Thanks for your help or i may have never tried again. So it turns out that you can send email from the recieve(email) method of your mailer after all. But for some reason both ways of sending email end up sending multiple emails instead of just one: http://www.ruby-forum.com/topic/182526#798332 ... Any clue why? -- 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 -~----------~----~----~----~------~----~------~--~---