- $top->attach(Data => encode($self->{charset},$self->{message}),
- Charset => $self->{charset},
- Type => $self->{contenttype},
- Encoding => 'quoted-printable');
+ push @parts, Email::MIME->create(
+ attributes => {
+ content_type => $self->{contenttype},
+ charset => $self->{charset},
+ encoding => 'quoted-printable',
+ },
+ body_str => $self->{message},
+ );
+
+ push @{ $self->{headers} }, (
+ 'Content-Type' => qq|$self->{contenttype}; charset="$self->{charset}"|,
+ );