Skip to content

Commit

Permalink
Resolved Issue mikel#6 - Ordering of add_file and body items causes i…
Browse files Browse the repository at this point in the history
…nvalid emails (updated rdoc)
  • Loading branch information
mikel committed Nov 12, 2009
1 parent 15894ad commit e7322aa
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions lib/mail/message.rb
Expand Up @@ -147,11 +147,15 @@ def header(value = nil)
# mail.body = nil
# mail.body.encoded #=> ''
#
# WARNING!!
#
# Setting a body on a multipart email makes no sense as a multipart email
# is a body that is made up of many parts, and you really need to tell mail
# which part to change the body of. This will raise a RuntimeError.
# If you try and set the body of an email that is a multipart email, then instead
# of deleting all the parts of your email, mail will add a text/plain part to
# your email:
#
# mail.add_file 'somefilename.png'
# mail.parts.length #=> 1
# mail.body = "This is a body"
# mail.parts.length #=> 2
# mail.parts.last.content_type.content_type #=> 'This is a body'
def body=(value)
case
when value == nil
Expand Down

0 comments on commit e7322aa

Please sign in to comment.