Navigation Menu

Skip to content

Commit

Permalink
Add cc capability. Pass :cc in opt hash to TMail.
Browse files Browse the repository at this point in the history
  • Loading branch information
Nickolas Means committed Oct 5, 2009
1 parent d946480 commit 13f5e85
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion lib/pony.rb
Expand Up @@ -32,6 +32,7 @@ def self.build_tmail(options)
mail = TMail::Mail.new
mail.to = options[:to]
mail.from = options[:from] || 'pony@unknown'
mail.cc = options[:cc] || ''
mail.subject = options[:subject]
if options[:attachments]
# If message has attachment, then body must be sent as a message part
Expand All @@ -44,7 +45,7 @@ def self.build_tmail(options)
attachment = TMail::Mail.new
attachment.transfer_encoding = "base64"
attachment.body = Base64.encode64(body)
content_type = MIME::Types.type_for(name)
content_type = MIME::Types.type_for(name).to_s
attachment.content_type = content_type unless content_type == ""
attachment.set_content_disposition "attachment", "filename" => name
mail.parts.push attachment
Expand Down
6 changes: 3 additions & 3 deletions pony.gemspec
Expand Up @@ -2,7 +2,7 @@

Gem::Specification.new do |s|
s.name = %q{pony}
s.version = "0.3.3"
s.version = "0.3.4"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Nickolas Means"]
Expand All @@ -16,6 +16,6 @@ Gem::Specification.new do |s|
s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.1}
s.summary = s.description
s.add_dependency ('tmail', '>= 1.2.3')
s.add_dependency ('mime-types', '>= 1.16')
s.add_dependency('tmail', '>= 1.2.3')
s.add_dependency('mime-types', '>= 1.16')
end

0 comments on commit 13f5e85

Please sign in to comment.