I am using the Devise gem and I have an initializer to setup mail as below:
ActionMailer::Base.smtp_settings = {
:enable_starttls_auto => true,
:address => 'smtp.gmail.com',
:port => 587,
:domain => 'mydomain.com',
:authentication => 'plain',
:user_name => 'info@mydomain.com',
:password => 'password'
}
In devise.rb I have also set the following:
config.mailer_sender = "info@mydomain.com"
The problem I have is that when I try sent the “Forgot your password” email. My application does send the email but the link to allow me to reset the email contains the gmail domain, as follows:
http://gmail.com/users/password/edit?reset_password_token=JDKdSyhtDBkyq4Sgs2J3
I obviously need that domain to be my application’s domain so the user can reset their password. What do I need to change?
Weird configuration, I usually simply set:
In my production or development
.rbfileJust understood,
config.mailer_sender = "info@mydomain.com"is meant to fill in yourfromfield.