+ my ($ContentEncoding, $Body) = $self->_EncodeLOB( $Attachment->bodyhandle->as_string,
+ $Attachment->mime_type
+ );
+ my $id = $self->SUPER::Create(
+ TransactionId => $args{'TransactionId'},
+ ContentType => $Attachment->mime_type,
+ ContentEncoding => $ContentEncoding,
+ Parent => $args{'Parent'},
+ Headers => $Attachment->head->as_string,
+ Subject => $Subject,
+ Content => $Body,
+ Filename => $Filename,
+ MessageId => $MessageId,
+ );
+ unless ($id) {
+ $RT::Logger->crit("Attachment insert failed - ".$RT::Handle->dbh->errstr);
+ }