OpenSource For You

The Javamail API

-

vou’ve now reached a point where you have to take a short detour. For your next step, you need something through which you FouOG sHnG Dn HPDLO Wo WhH :Dy2606 ,D usLnJ -DYD. YHs, the JavaMail API, the fourth and last ingredient. rsing this API, you can write programs to send, receive and manage HPDLOs YHUy HIfiFLHnWO­y Ln -DYD. ThH GHYHOopHUs oI WhLs A3, have designed it so beautifull­y that applicatio­n developers only have to write a few lines of code to get it running. It’s absolutely free to download from http://goo.gl/C38nv and is under active developmen­t. Download version 1.4.5, which is the latest at the time of writing this article. Follow these simple steps to integrate it with your Two Step Ver project: 1. (xWUDFW WhH zLp fiOH Wo WhH pUoMHFW IoOGHU ( TSV in this case). 2. 6wLWFh Wo WhH 1HWBHDns wLnGow DnG ULJhW-FOLFN Two Step

Ver in the Projects panel and choose the Properties option. 3. In the Project Properties window, select Libraries under

Categories and click Add JAR/Folder 4. In the Add JAR/Folder window, navigate to the JavaMail

API folder, select mail.jar and click Open. 5. COLFN OK in the Project Properties window, and that’s LW—you’UH GonH. 5HWuUnLnJ Wo WhH FoGH—you nHHG Wo DGG FoGH Wo sHnG the randomly generated code to the registered cell phone nuPbHU WhUouJh 606. )LUsW DGG WhHsH OLnHs DW WhH bHJLnnLnJ, as shown below:

package tsv; import javax.mail.*; import javax.mail.internet.*;

Now, replace /*<<To be continued….>>*/ with the following code: L*petting the mail server properties*L

java.util.mroperties props = new java.util. mroperties(); props.put(“mail.smtp.host”,”smtp.gmail.com”); props.put(“mail.smtp.socketcact­ory.port”, “4S5”); props.put(“mail.smtp.socketcact­ory.class”,”javax.net. ssl.ppipocketc­actory”);

Newspapers in English

Newspapers from India