ich auf eine Anwendung arbeite, die jedoch von MIMEEntity, E-Mail-Inhalte anzuzeigen, merke ich, wenn es Inline-Bilder in der E-Mail ist, ersetzen sie das Bild mit Bild-Platzhalter XPages: Anzeige E-Mail-Inhalte mit Inline-Bilder
und wann immer es ist ein leerer E-Mail-Inhalte mit pdf attachement, erhalte ich eine Zeichenfolge wie:
%PDF-1.3
%ÔÒ¤Ë
%RSTXPDF3 Parameters: ERSXh
2 0 obj
<<
/Type /FontDescriptor
/Ascent 720
/CapHeight 660
/Descent -270
/Flags 32
/FontBBox [-177 -269 1123 866]
/FontName /Helvetica
/ItalicAngle 0
/StemV 105
>>
endobj
3 0 obj
/WinAnsiEncoding
endobj
4 0 obj
<<
%Devtype PDF1 Font HELVE normal Lang DE
/Type /Font
/Subtype /Type1
/BaseFont /Helvetica
/Name /F001
/Encoding 3 0 R
/FirstChar 32
/LastChar 255
%Charwidth values from PDF1 HELVE 080 normal
/Widths
[ 278 275 356 556 556 888 669 225 331 331 388 581 275 331 275 275 556 556 556 556 556 556 556 556 556 556 275 275 581 581 581 556 1013 669 669 725 725 669 613 775 725 275 500 669 556 831 725 775 669 775 725 669 613 725 669 944 669 669 613 275 275 275 469
556 225 556 556 500 556 556 275 556 556 225 225 500 225 831 556 556 556 556 331 500 275 556 500 725 500 500 500 331 263 331 581 0 556 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 331 556 556 556 556 263 556 331 738 369 556 581 0 738
331 331 581 331 331 331 500 538 275 331 331 363 556 831 831 831 613 669 669 669 669 669 669 1000 725 669 669 669 669 275 275 275 275 725 725 775 775 775 775 775 581 775 725 725 725 725 669 669 613 556 556 556 556 556 556 888 500 556 556 556 556 275 275
275 275 556 556 556 556 556 556 556 581 613 556 556 556 556 500 556 500]
/FontDescriptor 2 0 R
>>
endobj
5 0 obj
<<
/Type /FontDescriptor
/Ascent 720...
Unten ist mein Code:
public static String getEmailContent(MIMEEntity mime) throws NotesException {
String text = null;
String html = null;
if (mime != null) {
if ("multipart".equalsIgnoreCase(mime.getContentType())) {
MIMEEntity child = mime.getFirstChildEntity();
while (child != null) {
String mimeType = child.getContentType() + "/" + child.getContentSubType();
child.decodeContent();
String contentDecoded = child.getContentAsText();
if ("text/html".equals(mimeType)) {
if (html == null) {
html = contentDecoded;
}
} else if ("text/plain".equals(mimeType)) {
if (text == null) {
text = "<pre>" + contentDecoded + "</pre>";
}
}
// get next Child-Element
MIMEEntity tmpChild = child.getFirstChildEntity();
if (tmpChild == null) {
tmpChild = child.getNextSibling();
if (tmpChild == null) {
tmpChild = child.getParentEntity();
if (tmpChild != null)
tmpChild = tmpChild.getNextSibling(); }
}
child = tmpChild;
}
} else if ("text".equalsIgnoreCase(mime.getContentType())) {
String subType = mime.getContentSubType();
mime.decodeContent();
String contentDecoded = mime.getContentAsText();
if ("html".equalsIgnoreCase(subType)) {
if (html == null) {
html = contentDecoded;
}
} else if ("plain".equalsIgnoreCase(mime.getContentSubType())) {
if (text == null) {
text = "<pre>" + contentDecoded + "</pre>";
}
}
} else {
mime.decodeContent();
text = "<pre>" + mime.getContentAsText() + "</pre>";
}
}
if (html != null) {
return html;
} else {
return text;
}
}
Ich weiß nicht, was ich falsch mache, ich brauche etwas Hilfe