Both user and secret are required, an error from sending ema


#1

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 = “removed_email_address@domain.invalid”
@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!