Email::MIME::Creator - obsolete do-nothing library


Email-MIME documentation Contained in the Email-MIME distribution.

Index


Code Index:

NAME

Top

Email::MIME::Creator - obsolete do-nothing library

SYNOPSIS

Top

You don't need to use this module for anything.

PERL EMAIL PROJECT

Top

This module is maintained by the Perl Email Project.

http://emailproject.perl.org/wiki/Email::MIME::Creator

ORIGINAL AUTHOR

Top

Do not send bug reports to: Casey West, <casey@geeknest.com>.

COPYRIGHT

Top


Email-MIME documentation Contained in the Email-MIME distribution.

package Email::MIME::Creator;
use strict;

use vars qw[$VERSION];
$VERSION = '1.908';

use base q[Email::Simple::Creator];
use Email::MIME;
use Encode ();

sub _construct_part {
  my ($class, $body) = @_;

  my $is_binary = $body =~ /[\x00\x80-\xFF]/;

  my $content_type = $is_binary ? 'application/x-binary' : 'text/plain';

  Email::MIME->create(
    attributes => {
      content_type => $content_type,
      encoding     => ($is_binary ? 'base64' : ''),  # be safe
    },
    body => $body,
  );
}

1;

__END__