tl  tr
  Home | Tutorials | Articles | Videos | Products | Tools | Search
Interviews | Open Source | Tag Cloud | Follow Us | Bookmark | Contact   
 Tools and Libs > Open Symphony Core > Link Email

Link Email 

OSCore (Open Symphony Core) is a java library with lot of utilities and reusable components. This requires the libraries oscore-2.2.6.jar, mail.jar to be in classpath. The following example shows using TextUtils.linkEmail() API.

File Name  :  
com/bethecoder/tutorials/oscore/LinkEmailTest.java 
Author  :  Sudhakar KV
Email  :  [email protected]
   
package com.bethecoder.tutorials.oscore;

import com.opensymphony.util.TextUtils;

public class LinkEmailTest {

  /**
   @param args
   */
  public static void main(String[] args) {

    String linkHtml = TextUtils.linkEmail("[email protected]");
    System.out.println(linkHtml);
    
    linkHtml = TextUtils.linkEmail("<span>INFO [[email protected]]</span>");
    System.out.println(linkHtml);
  }

}
   

It gives the following output,
<a href='mailto:[email protected]'>[email protected]</a>
<span>INFO [<a href='mailto:[email protected]'>[email protected]</a>]</span>



 
  


  
bl  br