We can set the default host for all of our methods in Mailer.
For this, we need to write one method in ApplicationController file with following code and call this method using before_filter,
ActionMailer::Base.default_url_options[:host] = request.host
or
ActionMailer::Base.default_url_options[:host] = request.host_with_port
Hope this will be helpful for someone.