diff --git a/kmail/kmreaderwin.cpp b/kmail/kmreaderwin.cpp index 1e4eab6d..26c5573e 100644 --- a/kmail/kmreaderwin.cpp +++ b/kmail/kmreaderwin.cpp @@ -1775,8 +1775,12 @@ TQString KMReaderWin::writeMessagePartToTempFile( KMMessagePart* aMsgPart, int slashPos = fileName.findRev( '/' ); if( -1 != slashPos ) fileName = fileName.mid( slashPos + 1 ); - if( fileName.isEmpty() ) + if( fileName.isEmpty() ) { fileName = "unnamed"; + // Save html emails with extension + if (aMsgPart->subtype() == DwMime::kSubtypeHtml ) + fileName += ".html"; + } fname += "/" + fileName; TQByteArray data = aMsgPart->bodyDecodedBinary(); @@ -3041,11 +3045,11 @@ TQString KMReaderWin::renderAttachments(partNode * node, const TQColor &bgColor html += ""; } } else { + TQString fileName = writeMessagePartToTempFile( &node->msgPart(), node->nodeId() ); partNode::AttachmentDisplayInfo info = node->attachmentDisplayInfo(); if ( info.displayInHeader ) { html += "