class Mail::Message
  def from_address
    Mail::Address.new from.first
  end

  def recipients_addresses
    convert_to_addresses recipients
  end

  def to_addresses
    convert_to_addresses to
  end

  def cc_addresses
    convert_to_addresses cc
  end

  def bcc_addresses
    convert_to_addresses bcc
  end

  private
    def convert_to_addresses(recipients)
      Array(recipients).collect { |recipient| Mail::Address.new recipient }
    end
end

class Mail::Message
  def from_address
    header[:from]&.address_list&.addresses&.first
  end

  def recipients_addresses
    to_addresses + cc_addresses + bcc_addresses
  end

  def to_addresses
    Array(header[:to]&.address_list&.addresses)
  end

  def cc_addresses
    Array(header[:cc]&.address_list&.addresses)
  end

  def bcc_addresses
    Array(header[:bcc]&.address_list&.addresses)
  end
end

Use the address lists that have already been supplied to ensure we get the names as well
Use the address lists that have already been supplied to ensure we get the names as well
