Search results
Mar 26, 2014 · The session is the context of how you are going to interact with the mail host. This includes but not limited to debugging output from the mail host, timeouts, and authentication mechanisms. If you want to interact with the same mail host in different ways then the session is the object that holds this information.
Parameters: props - Properties object. Used only if a new Session object is created. It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
- name that implements this protocol.
- Optional string identifying the vendor.
- Valid entries are store and transport.
Methods in javax.mail.internet with parameters of type Session. Modifier and Type. Method and Description. protected MimeMessage. MimeMessage. createMimeMessage (Session session) Create and return a MimeMessage object.
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, boolean isSSL) Constructor used by this class and by SMTPSSLTransport subclass.
JavaMail Session Properties. You can set properties for a JavaMail Session object. Every property name must start with a mail-prefix. The GlassFish Server changes the dash (-) character to a period (.) in the name of the property and saves the property to the MailConfiguration and JavaMail Session objects.
Parameters: props - Properties object that hold relevant properties. It is expected that the client supplies values for the properties listed in Appendix A of the JavaMail spec (particularly mail.store.protocol, mail.transport.protocol, mail.host, mail.user, and mail.from) as the defaults are unlikely to work in all cases.
People also ask
How do I set properties for a JavaMail Session object?
What is the purpose of creating a session object in JavaMail?
What is JavaMail TM API?
How do I create a JavaMail session?
What is a JVM session?
Why are my property settings ignored in JavaMail?
Note also that the Properties object is used only the first time this method is called, when a new Session object is created. Subsequent calls return the Session object that was created by the first call, and ignore the passed Properties object. Use the getInstance method to get a new Session object every time the method is called.