Q:

Rails mailer alternate from address

I can set a default from address in a rails like so;
    class UserMailer < ActionMailer::Base
      default :from => "\"Company\" <company@example.com>"

      def custom_address(user)
        # I want to set the from address here
        mail(to: user.email, subject: 'Custom from address')
      end
    end

but how do I set a custom address for a different method? I can't see it listed anywhere in the docs

A:

I may be wrong, but I believe you can just override the from within the mail method.
class UserMailer < ActionMailer::Base
          default :from => "\"Company\" <company@example.com>"

          def custom_address(user)
            # I want to set the from address here
            mail(to: user.email, subject: 'Custom from address', from: 'asdf@other.com')
          end
        end

