正在加载图片...
第11章 Javamail与在线邮件 设定发送邮件服务器与传输协议 指定要寄信的邮件服务器地址,以及使用的通信协议,这个部份由Java类 Properties的方法成员putO所提供 put(Object key, Object value Key代表所要设定的属性种类,如果要设定邮件服务器地址,key的值 必须指定为 maill. host Value则是地址字符串,如果是通信协议,则该值是 mailtransport protocol, value值固定为smtp > Properties对象的设定程序片段,首先建立所需的 Propertie对象 theProperties Properties theProperties= System. getPropertiesO theProperties put("mail host", 127.0.0.1") theProperties put("mail transport protocol",smtp") JSP动态网页新技术 3第11章JavaMail与在线邮件 JSP 动态网页新技术 3 设定发送邮件服务器与传输协议 ➢ 指定要寄信的邮件服务器地址,以及使用的通信协议,这个部份由Java类 Properties的方法成员put()所提供 。 put(Object key, Object value) – Key 代表所要设定的属性种类,如果要设定邮件服务器地址,key的值 必须指定为mail.host。 – Value则是地址字符串,如果是通信协议,则该值是 mail.transport.protocol,value值固定为smtp。 ➢ Properties对象的设定程序片段,首先建立所需的Properties对象 theProperties Properties theProperties = System.getProperties() ; theProperties.put("mail.host","127.0.0.1") ; theProperties.put("mail.transport.protocol","smtp") ;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有