++ed by:

2 PAUSE users
1 non-PAUSE user.

Dave Rolsky


Courriel::Part::Multipart - A part which contains other parts


version 0.11


  my $headers = $part->headers();
  my $ct = $part->content_type();

  for my $subpart ( $part->parts ) { ... }


This class represents a multipart email part which contains other parts.


This class provides the following methods:

Courriel::Part::Multipart->new( ... )

This method creates a new part object. It accepts the following parameters:

  • parts

    An array reference of part objects (either Single or Multipart). This is required, but could be empty.

  • content_type

    A Courriel::ContentType object. This defaults to one with a mime type of "multipart/mixed".

  • boundary

    The part boundary. If none is provided, a unique value will be generated.

  • preamble

    Content that appears before the first part boundary. This will be seen by email clients that don't understand multipart messages.

  • epilogue

    Content that appears after the final part boundary. The spec allows for this, but it's probably not very useful.

  • headers

    A Courriel::Headers object containing headers for this part.


Returns an array (not a reference) of the parts this part contains.


Returns the number of parts this part contains.


Returns the part boundary.


Returns the mime type for this part.


Returns the Courriel::ContentType object for this part.


Returns the Courriel::Headers object for this part.

$part->is_inline(), $part->is_attachment()

These methods always return false, but exist for the sake of providing a consistent API between Single and Multipart part objects.


Returns true.


The preamble as passed to the constructor.


The epilogue as passed to the constructor.


Returns the Courriel or Courriel::Part::Multipart object to which this part belongs, if any. This is set when the part is added to another object.


Returns the part as a string, along with its headers. Lines will be terminated with "\r\n".


This class does the Courriel::Role::Part and Courriel::Role::HasParts roles.


Dave Rolsky <autarch@urth.org>


This software is Copyright (c) 2011 by Dave Rolsky.

This is free software, licensed under:

  The Artistic License 2.0 (GPL Compatible)