Skip to Content

Unfortunately we could not use the notification event in KM for various reasons. Most notably, we were not notifying upon an action on a KM object. We needed something simple, flexible, and fast.

Here’s what I came up with:

import java.util.*;

public class SMTP extends Thread{
     public String whoto;
     public String username;
     public String whofrom;
/* our constructor */
public SMTP(String whoto, String username, String whofrom){
          this.whoto = whoto;
          this.username = username;
          this.whofrom = whofrom;
/* run method for multithreading */
     public void run(){
     public void doGet( )
     try {

          SmtpClient smtp =
                           new SmtpClient("");
          //Pass the email address of the recipient of the
          // message to the next method.

       //Get an output stream for the message
          PrintStream msg = smtp.startMessage();
          //Write the message header in the output stream.
          msg.println("To: "+whoto);
          msg.println("Subject: New Email");
          //Write the text of the message in the output
          // stream
          msg.println("An event has happened.");
          msg.println("Please do not reply to this automated email.");

       //Close the stream and send the message

     }catch( Exception e ) {

This method is called by:

IUser loggedOnUser = (IUser) request.getUser().getUser()
SMTP mysmtp = new SMTP(whoto, loggedOnUser.getName(), whofrom);
mysmtp.start(); // starts the thread
To report this post you need to login first.


You must be Logged on to comment or reply to a post.

  1. Former Member
    Hi Jason,

    Good one. Unfortunately, I’m surprised to see  none has added comment to this basic good stuff.

    Though this is late, but a better one for you!


  2. Former Member
    In your solution the content in the email is plain text. Is it possible to add a hyperlink in the content that recipient can click and open it.

    Thanks for reply.

    Kind regards.



Leave a Reply