---
title: "outlook邮件内容丢失与Mail API异常"
author: "hello_a_hao"
date: "2012-08-24T15:45:40Z"
tags: []
categories: ["Web前端"]
slug: "outlook-mail-api"
draft: false
lastmod: "2012-08-24T15:45:40Z"
id: 1661883
url: "https://hello-a-hao.iteye.com/blog/1661883"
---

问题现象：

1、当日历发件人名称中存在如：**\` % ^ { } | \\ " &lt; &gt;** 特殊字符时，mail api异常

2、当outlook邮件内容中包含如：**&lt;**  特殊字符时，&lt;后的内容均丢失

 

定位结果：

1、outlook应该是不能不进行URLEncoder反转码的，所以，对如上的特殊字符进行转码行不通，所以邮件中会显示被转后的UTF-8编码

2、outlook是按html语言进行解析，帮对**&lt;**字符敏感，代码中只需要用HtmlUtils.htmlEscape()方法进行转码即可。

注：HtmlUtils类为spring中的类

 

以上仅为自己问题定位结果，仅供参考。