我们最近将JavaMail API升级到最新版本1.5.4。升级后,我们发现附件(文件名> 60个字符)在Outlook中配置为.dat文件名(配置了POP3)。请注意,此问题仅在文件名为>时出现。使用POP3配置了60个字符和Outlook。
我们注意到名字&在JAVAMAIL升级后,filename属性将变为多行。
Content-Type: application/octet-stream;
name=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252272708.PDF
Content-Disposition: attachment;
filename=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252272708.PDF
Content-Type: application/octet-stream;
name*0=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252;
name*1=272708.PDF
Content-Disposition: attachment;
filename*0=Automation_Team_Directory_05-Dec-2015_123219_21312_155018252;
filename*1=272708.PDF
我们如何解决问题,以便在Outlook中使用POP3正确显示附件?
答案 0 :(得分:3)
将系统属性var linkText = vis.selectAll('g.link-text').data(
links,
function (d) { return d.target.id; }
);
设置为mail.mime.encodeparameters
。这会在创建消息时禁用RFC 2231支持。
答案 1 :(得分:0)
我之所以来到这里,是因为我遇到了同样的问题,即从最近收到更新其Java Mail补丁的Coldfusion 11、2016和2018的较新版本中通过电子邮件发送附件。
这再次确认了在日语网站上找到的条目,您可以通过“管理”屏幕或编辑 jvm.config < / strong>文件。
http://cfassociates.samuraiz.co.jp/index.cfm/faq/cftech/cfmail-attachfilename-garbled/
然后要添加的属性是:
Public Declare PtrSafe Function SetCursorPos Lib "user32" (ByVal x As Long, ByVal y As Long) As LongPtr
Public Declare PtrSafe Sub mouse_event Lib "user32" (ByVal dwFlags As Long, ByVal dx As Long, ByVal dy As Long, ByVal cButtons As Long, ByVal dwExtraInfo As Long)
Public Const MOUSEEVENTF_LEFTDOWN = &H2
Public Const MOUSEEVENTF_LEFTUP = &H4
Declare Sub Sleep Lib "kernel32" (ByVal dwMilliseconds As Long)
Sub Timer()
Dim t As Date, tStop As Date
t = Now
tStop = t + TimeValue("19:43:00") 'Adjust the TimeValue as needed "hh:mm:ss"
Do Until t = tStop
DoEvents
SetCursorPos 634, 371 'x and y position
mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0
Sleep 5000
mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0
t = Now
Loop
MsgBox "t = " & t & vbCrLf & "tStop = " & tStop
End Sub
您会发现它如上所述改变了用于定义附件的标头样式。