class Mail::Message
def body=(value)
mail.parts.length #=> 2
mail.body = "This is a body"
mail.parts.length #=> 1
mail.add_file 'somefilename.png'
your email:
of deleting all the parts of your email, mail will add a text/plain part to
If you try and set the body of an email that is a multipart email, then instead
mail.body.encoded #=> ''
mail.body = nil
mail.body.encoded #=> 'this is the body'
mail.body = 'this is the body'
Example:
You can also reset the body of an Message object by setting body to nil
mail.body #=> #
Example:
Sets the body object of the message object.
def body=(value) body_lazy(value) end