mirror of
https://github.com/moparisthebest/davmail
synced 2025-02-28 09:21:49 -05:00
Failover for invalid mime headers : at least write body
git-svn-id: http://svn.code.sf.net/p/davmail/code/trunk@75 3d1905a2-6b24-0410-a738-b14d5a86fcbd
This commit is contained in:
parent
81ad8b85c5
commit
5fea29a973
@ -949,6 +949,20 @@ public class ExchangeSession {
|
||||
os.write('\r');
|
||||
os.write('\n');
|
||||
}
|
||||
// failover for invalid mime headers : at least write body
|
||||
if (attachmentIndex == 0) {
|
||||
MimeHeader bodyHeader = new MimeHeader();
|
||||
bodyHeader.contentType = "text/html";
|
||||
bodyHeader.charset = "utf-8";
|
||||
StringBuffer headerBuffer = new StringBuffer();
|
||||
headerBuffer.append(mimeHeader.boundary).append("\r\n");
|
||||
headerBuffer.append("Content-Type: text/html; charset=UTF-8\r\n");
|
||||
headerBuffer.append("Content-Transfer-Encoding: 7bit\r\n");
|
||||
headerBuffer.append("\r\n");
|
||||
os.write(headerBuffer.toString().getBytes());
|
||||
writeBody(os, bodyHeader);
|
||||
os.write((mimeHeader.boundary+"--\r\n").getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
protected void writeAttachment(OutputStream os, MimeHeader mimeHeader, Attachment attachment) throws IOException {
|
||||
|
Loading…
x
Reference in New Issue
Block a user