java mail中"setDebug()"是什么意思,有什么作用?

如题所述

查看了下API:
public void setDebug(boolean debug)
Set the debug setting for this Session. 
Since the debug setting can be turned on only after the Session has been 
created, to turn on debugging in the Session constructor, set the property 
mail.debug in the Properties object passed in to the constructor to 
true. The value of the mail.debug property is used to initialize 
the per-Session debugging flag. Subsequent calls to the setDebug 
method manipulate the per-Session debugging flag and have no affect on the mail.debug property.Parameters:debug - Debug setting
也就是可以从控制台中看一下服务器的响应信息

JavaMail,顾名思义,提供给开发者处理电子邮件相关的编程接口。它是Sun发布的用来处理email的API。它可以方便地执行一些常用的邮件传输。我们可以基于JavaMail开发出类似于Microsoft Outlook的应用程序。

温馨提示:答案为网友推荐,仅供参考
大家正在搜