Return a TMail::Addresses instance for each entry in the "To:" field of the mail object header.
If the "To:" field does not exist, will return nil by default or the value you pass as the optional parameter.
Example:
mail = TMail::Mail.new mail.to_addrs #=> nil mail.to_addrs([]) #=> [] mail.to = "Mikel <mikel@me.org>, another Mikel <mikel@you.org>" mail.to_addrs #=> [#<TMail::Address mikel@me.org>, #<TMail::Address mikel@you.org>]
Source Code
# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 170 def to_addrs( default = nil ) if h = @header['to'] h.addrs else default end end
<code/>and<pre/>for code samples.