public Method

Mail.each_header() { |key, v| ... }

Allows you to loop through each header in the TMail::Mail object in a block Example:

@mail['to'] = 'mikel@elsewhere.org'
@mail['from'] = 'me@me.com'
@mail.each_header { |k,v| puts "#{k} = #{v}" }
# => from = me@me.com
# => to = mikel@elsewhere.org

Source Code

# File action_mailer/vendor/tmail-1.2.2/tmail/mail.rb, line 252
def each_header
  @header.each do |key, val|
    [val].flatten.each {|v| yield key, v }
  end
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.