打了好几天,还是没有办法解决。
使用 HTML 和 JSP 视图技术实现在 java 中发送邮件。
如果我通过硬编码某个链接(在所有设备上,如 ipad、iphone、windows 等)只向任何电子邮件 ID 发送任何邮件,一切都很好
但是,通过保持该链接动态发送相同的邮件时,第一封邮件在所有设备上都可以,但是如果我再次将相同的邮件发送到相同的电子邮件 ID(此问题仅与 gmail id 相关)整个格式(对齐方式从中心向左改变) 对 iphone 和 ipad 感到不安(但对于台式机、笔记本电脑来说还可以)。
下面是我正在使用的代码:
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">"
+"\n<html xmlns=\"http://www.w3.org/1999/xhtml\">"
+"\n<head>\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\" />"
+"\n<title>Share Deal</title>\n</head>"
+"<table width=\"560\" border=\"0\" align=\"center\" bgcolor=\"#f4f2f3\" cellpadding=\"0\" cellspacing=\"0\"> " +
"<tr>\n <td height=\"70\" "
+ "align=\"center\"><a href=\""
+ logoLink
+ "\"><img alt='MNS Logo' src='"
+ logo
+ "' width=\"169\" "
+ "height=\"49\" /></td>\n </tr>\n <tr>\n <td align=\"center\">"
+ "<img alt='' src=\""
+ line
+ "\" width=\"558\" height=\"18\" /></td>\n "
+ "</tr>\n <tr>\n <td height=\"50\" align=\"center\" "
+ "style=\"font-family:Arial, Helvetica, sans-serif; font-size:16px; "
+ "font-weight:bold; color:#000;\">Hi" + receiverFirstName
+ "! " + "</td>\n </tr>"
+"<tr>\n<td height=\"40\" align=\"center\" "
+"style=\"font-family:Arial, Helvetica, sans-serif; "
+"font-size:13px; color:#858484; text-decoration:none;\">"
+"If this does not work, paste this link into your browser."
+"</td>\n </tr>\n <tr>\n <td height=\"20\" align=\"center\" "
+"style=\"font-family:Arial, Helvetica, sans-serif; font-size:9px; "
+"color:#858484; text-decoration:none;\">"
+"<a href=\"" + dynamicLink
+"\" style=\"font-family:Arial, Helvetica, sans-serif; font-size:13px; "
+"color:#858484; text-decoration:none;\">" + dynamicLink
+"</a> </td>\n</tr>\n"
+" <tr>\n <td height=\"60\" align=\"center\">\n"
+"<a href=\"#\"><img alt='facebook' src=\""+facebookImage+"\" width=\"25\" height=\"25\" /></a> \n"
+"<a href=\"#\"><img alt='pintrest' src=\""+pintrestImage+"\" width=\"25\" height=\"25\" /></a>\n"
+"<a href=\"#\"><img alt='twitter' src=\""+twitterImage+"\" width=\"25\" height=\"25\" /></a>\n"
+"</td>\n </tr>\n <tr>\n <td height=\"0\" align=\"center\" "
+"style=\"font-family:Arial, Helvetica, sans-serif; font-size:11px; "
+"color:#858484; text-decoration:none;\">\u00a9 2013 MapNSav | "
+"All Rights Reserved<br />\n <a href=\""+termsAndConditionsLink+"\" "
+"style=\"font-family:Arial, Helvetica, sans-serif; font-size:11px; "
+"color:#858484; text-decoration:none;\">Privacy Policy</a> | "
+"<a href=\""+termsAndConditionsLink+"\" style=\"font-family:Arial, Helvetica, sans-serif; "
+"font-size:11px; color:#858484; text-decoration:none;\">"
+"Terms and Conditions</a></td>\n </tr>";
我无法弄清楚原因,期待任何指向好的教程或建议的链接。任何帮助将不胜感激。