Returns an array of each destination in the email message including to: cc: or bcc:
Example:
mail.to = "Mikel <mikel@lindsaar.net>" mail.cc = "Trans <t@t.com>" mail.bcc = "bob <bob@me.com>" mail.destinations #=> ["mikel@lindsaar.net", "t@t.com", "bob@me.com"]
Source Code
# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 1003 def destinations( default = nil ) ret = [] %w( to cc bcc ).each do |nm| if h = @header[nm] h.addrs.each {|i| ret.push i.address } end end ret.empty? ? default : ret end
<code/>and<pre/>for code samples.