类 javax.mail.Session
的使用

使用 Session 的软件包
com.sun.mail.imap An IMAP protocol provider for the JavaMail API that provides access to an IMAP message store. 
com.sun.mail.pop3 A POP3 protocol provider for the JavaMail API that provides access to a POP3 message store. 
com.sun.mail.smtp An SMTP protocol provider for the JavaMail API that provides access to an SMTP server. 
javax.mail The JavaMailTM API provides classes that model a mail system. 
javax.mail.internet Classes specific to Internet mail systems. 
 

com.sun.mail.imapSession 的使用
 

参数类型为 Sessioncom.sun.mail.imap 中的构造方法
IMAPMessage(Session session)
          Constructor, for use by IMAPNestedMessage.
IMAPSSLStore(Session session, URLName url)
          Constructor that takes a Session object and a URLName that represents a specific IMAP server.
IMAPStore(Session session, URLName url)
          Constructor that takes a Session object and a URLName that represents a specific IMAP server.
IMAPStore(Session session, URLName url, String name, int defaultPort, boolean isSSL)
          Constructor used by this class and by IMAPSSLStore subclass.
 

com.sun.mail.pop3Session 的使用
 

参数类型为 Sessioncom.sun.mail.pop3 中的构造方法
POP3SSLStore(Session session, URLName url)
           
POP3Store(Session session, URLName url)
           
POP3Store(Session session, URLName url, String name, int defaultPort, boolean isSSL)
           
 

com.sun.mail.smtpSession 的使用
 

参数类型为 Sessioncom.sun.mail.smtp 中的构造方法
SMTPMessage(Session session)
          Default constructor.
SMTPMessage(Session session, InputStream is)
          Constructs an SMTPMessage by reading and parsing the data from the specified MIME InputStream.
SMTPSSLTransport(Session session, URLName urlname)
          Constructor
SMTPTransport(Session session, URLName urlname)
          Constructor that takes a Session object and a URLName that represents a specific SMTP server.
SMTPTransport(Session session, URLName urlname, String name, int defaultPort, boolean isSSL)
          Constructor used by this class and by SMTPSSLTransport subclass.
 

javax.mailSession 的使用
 

声明为 Sessionjavax.mail 中的字段
protected  Session Service.session
          The session from which this service was created.
protected  Session Message.session
          The Session object for this Message
 

返回 Sessionjavax.mail 中的方法
static Session Session.getDefaultInstance(Properties props)
          Get the default Session object.
static Session Session.getDefaultInstance(Properties props, Authenticator authenticator)
          Get the default Session object.
static Session Session.getInstance(Properties props)
          Get a new Session object.
static Session Session.getInstance(Properties props, Authenticator authenticator)
          Get a new Session object.
 Session MessageContext.getSession()
          Return the Session we're operating in.
 

参数类型为 Sessionjavax.mail 中的构造方法
Message(Session session)
          Constructor that takes a Session.
Service(Session session, URLName urlname)
          Constructor.
Store(Session session, URLName urlname)
          Constructor.
Transport(Session session, URLName urlname)
          Constructor.
 

javax.mail.internetSession 的使用
 

参数类型为 Sessionjavax.mail.internet 中的方法
protected  MimeMessage MimeMessage.createMimeMessage(Session session)
          Create and return a MimeMessage object.
static InternetAddress InternetAddress.getLocalAddress(Session session)
          Return an InternetAddress object representing the current user.
 

参数类型为 Sessionjavax.mail.internet 中的构造方法
MimeMessage(Session session)
          Default constructor.
MimeMessage(Session session, InputStream is)
          Constructs a MimeMessage by reading and parsing the data from the specified MIME InputStream.
 



Copyright © 2013. All Rights Reserved.