Jeremy
2008-Jul-29 22:31 UTC
ActionMailer Not Working After Changing Recipient Email Address
Greetings, Well though my crash-course on Rails, I''ve encountered a mystery that is driving my somewhat insane. Our previous web developer wrote a quick form on our site that allowed the user of the site to request a consultaion. The user simply fills in their name, email, phone number and a message, then submits the form. The form was working perfectly, but I wanted to change the subject line. So, I searched through all of my Rails files to determine where I would make that change. I found the appropriate file in "Models". class Mailer < ActionMailer::Base def consultation_request(details) @subject = ''Request'' @body = {:details => details} @recipients = ''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' @from = details[:email] end end In the process, I noticed that the message was currently being sent to my boss at ''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org''. For testing purposes, I changed his email to my email, ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' and sent a test message. It worked great! Then, I tried to see if I could have multiple recipients by formatting as follows: ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org; my-HMywgCz3680N+BqQ9rBEUg@public.gmane.org'' It did not work. I didn''t get any errors, but I didn''t receive any email either. Obviously, my syntax was wrong, so I changed it back to just be ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' and it still does not work. I can''t even get the original configuration to work. Any ideas? Thank you soooo much for any help you can provide. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
s.ross
2008-Aug-01 06:50 UTC
Re: ActionMailer Not Working After Changing Recipient Email Address
Hello-- On Jul 29, 2008, at 3:31 PM, Jeremy wrote:> > Greetings, > > Well though my crash-course on Rails, I''ve encountered a mystery that > is driving my somewhat insane. Our previous web developer wrote a > quick form on our site that allowed the user of the site to request a > consultaion. The user simply fills in their name, email, phone number > and a message, then submits the form. The form was working perfectly, > but I wanted to change the subject line. So, I searched through all of > my Rails files to determine where I would make that change. I found > the appropriate file in "Models". > > class Mailer < ActionMailer::Base > > def consultation_request(details) > @subject = ''Request'' > @body = {:details => details} > @recipients = ''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' > @from = details[:email] > end > end > > In the process, I noticed that the message was currently being sent to > my boss at ''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org''. For testing purposes, I changed his email > to my email, ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' and sent a test message. It worked great! > Then, I tried to see if I could have multiple recipients by formatting > as follows: > > ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org; my-HMywgCz3680N+BqQ9rBEUg@public.gmane.org'' > > It did not work. I didn''t get any errors, but I didn''t receive any > email either. Obviously, my syntax was wrong, so I changed it back to > just be ''my-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'' and it still does not work. I can''t even get > the original configuration to work. Any ideas? Thank you soooo much > for any help you can provide. >Recipients should be an array of strings. If you use a comma-separated list, that should work as well. So, recipients [''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org'', ''me-B4qg7kJ0jjfQT0dZR+AlfA@public.gmane.org''] is probably best (note that recipients is actually a method and not an assignment to an instance variable). You could also do: recipients ''boss-zuv13RyHHZkAvxtiuMwx3w@public.gmane.org, me-B4qg7kJ0jjfQT0dZR+AlfA@public.gmane.org'' on many systems. HTH --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---