Maricris Nonato
2007-Jan-06 08:36 UTC
both user and secret are required, an error from sending ema
Hi,
Can anybody please tell me what this error means?
"both user and secret are required"
I was trying to send an email. I had my environment.rb configured to
have the following (because I was running in development):
ActionMailer::Base.server_settings = {
:address => "smtp.myrealdomain.net",
:port => 25,
:username => ''myusername'',
:password => ''mypassword'',
:authentication => ''plain''
}
and my model goes like this:
class Notifier < ActionMailer::Base
def update_email( user )
@recipients = "me@myemailcom"
@from = "m...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org"
@subject = "New Email Address Information"
# Email body variable substitutions go here
@body["firstname"] = user.firstname
@body["lastname"] = user.lastname
@body["activation"] = user.activation
@body["password"] = user.password
@body["username"] = user.username
end
end
and I invoke it from my method as such:
def updateEmailDetail
@cuser = User.find(params[:current_user][:id])
...
if @cuser.update_attributes(params[:current_user])
flash[''notice''] = ''Successful
update''
Notifier::deliver_update_email(@cuser)
else
flash[''error''] = ''An error
occurred.''
end
...
redirect_to :controller => ''home'', :action =>
''acct'', :cat =>
''account''
end
When I do execute the method, I get the error "both user and secret are
required". Does any body know what this means? I hope someone might
see this post and shed some light. Is there something wrong about the
way I called it?
Many thanks!
--
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
-~----------~----~----~----~------~----~------~--~---