任何人都可以给我一些示例代码,说明如何在值超过 thrsold 时生成邮件
你好,我正在监视 jvm,我正在获取它的静态信息,例如内存、线程数等 我想根据该条件生成邮件通知。 能给我一些关于如何生成邮件的示例代码吗
hi i am monitoring jvm and i am getting it statics like memory,number of threads etc
and i want to generate mail notification depending on that conditions. can any give me some sample code on how to generate mails
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
JavaMail 下载包含如何使用 javax.mail API 的示例:
http:// /java.sun.com/products/javamail/FAQ.html#examples
查看 javamail-1.4.2.zip 中的演示文件夹
另一种方法是使用 log4j 或其他支持“Smtp”的日志记录框架/电子邮件”附加程序。 有关如何设置电子邮件日志记录的示例,请参阅 log4j 站点。
The JavaMail download contains examples for how to use the javax.mail API:
http://java.sun.com/products/javamail/FAQ.html#examples
Look at the demo folder in the javamail-1.4.2.zip
Another approach would be to use log4j or another logging framework that supports an "Smtp/Email" appender. See the log4j site for examples on how to setup email logging.