public Method

Mail.friendly_from( default = nil )

Returns the "friendly" human readable part of the address

Example:

mail = TMail::Mail.new
mail.from = "Mikel Lindsaar <mikel@abc.com>"
mail.friendly_from #=> "Mikel Lindsaar"

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/interface.rb, line 403
def friendly_from( default = nil )
  h = @header['from']
  a, = h.addrs
  return default unless a
  return a.phrase if a.phrase
  return h.comments.join(' ') unless h.comments.empty?
  a.spec
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.