@@ -, +, @@ --- C4/Letters.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/C4/Letters.pm +++ a/C4/Letters.pm @@ -1247,10 +1247,10 @@ sub _add_attachments { $message->text_body( $letter->{content} ); } - foreach my $attachment ( @$attachments ) { + foreach my $attachment (@$attachments) { $message->attach( Encode::encode( "UTF-8", $attachment->{content} ), - content_type => 'application/octet-stream', + content_type => ( exists $attachment->{type} && $attachment->{type} ne '' ) ? $attachment->{type} : 'application/octet-stream', name => $attachment->{filename}, disposition => 'attachment', ); --