I made an application using JavaMail which reads e-mail and takes its content. The content will be fetched in HTML. This content will be analyzed and then forwarded to another e-mail address.
我使用JavaMail創建了一個應用程序,它可以讀取電子郵件並獲取其內容。內容將以HTML格式提取。將分析此內容,然后將其轉發到另一個電子郵件地址。
I've tested the e-mail's layout in Chrome, Mozilla, Outlook, Office 365, Thunderbird and Internet Explorer. Everything works well, except, of course, IE.
我已經在Chrome,Mozilla,Outlook,Office 365,Thunderbird和Internet Explorer中測試了電子郵件的布局。一切都運作良好,當然除了IE。
I made some screenshots, one in Chrome and the other in Internet Explorer, both from the same mail client (Office 365).
我在同一個郵件客戶端(Office 365)上制作了一些截圖,一個在Chrome瀏覽器中,另一個在Internet Explorer中。
Good email in Chrome
Misformed IE E-mail
I put together a multipart e-mail, a part for the content and one for attachments. This is the code I am using:
我整理了一份多部分電子郵件,一部分內容和一部分附件。這是我正在使用的代碼:
public void SentTest(String messageContent) throws IOException, ParseException, NoSuchProviderException {
//Only get text between HTML tags
Pattern pattern = Pattern.compile(".*?(.*?)