The SSL protocol provides a secure way for exchanging data on the internet including eg. In the following paragraph I'm going to explain the procedure of setting up a Java Mail session which is able to send messages via SSL (Secure Sockets Layer) protocol. The Java Mail session is one of these resources. Before the application is deployed it is necessary to configure all resources required by the application. Once the code is compiled and packaged to the war or ear archive it is the time to deploy it on the application server. Use the 'send' static method of the Transport Adjust the date of sending the message practice to indicate the software which This is not mandatory, however, it is a good an object of the InternetAddress class. Message message = new MimeMessage(mailSession) The code that constructs, initializes and sends an email message can look as follows: If the lookup fails the container raises an exception and prevents the component from being = "mail/myMailSession") If it succeeds it injects the resource to the field. Once it stumbles upon such a field it reads the name attribute and tries to find a corresponding resource. During the component's initialization the container performs the dependency injection which includes an inspection of all fields annotated with this annotation. The name attribute of this annotation holds the name of the Java Mail resource defined and configured on the application server. a servlet or an EJB bean) he/she declares a field of class and annotates it with annotation. In the component's class responsible for sending emails (eg. From the programmer's standpoint Java EE 5 makes sending emails very easy.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |