my $subject = "FLR invoices"; my $msg = MIME::Entity->build( From => SOURCE, To => TARGET, Subject => $subject, Type => "multipart/mixed", ); my $textpart = <attach( Type => 'text/plain', Encoding => '7bit', Data => $textpart, ); # Add the XML file $msg->attach( Type => 'text/xml', Encoding => 'base64', Description => "XML file $xmlfile", Path => $xmlfile, ); $msg->send( 'sendmail' );