title: Email sending not working using Apache James
body: <p>I am trying to send email using apache james but the emails are not getting delievered. Below is my code.</p>
  
  <pre><code>import java.util.*;
  import javax.mail.*;
  import javax.mail.internet.*;
  
  public class test {
  
      public static void main(String args[]) throws Exception {
  
          String user = "test";  
  
          String password = "test"; 
          String fromAddress = "test@localhost";   
          String toAddress = "test@gmail.com";        
          Properties properties = new Properties();     
          properties.put("mail.smtp.host", "localhost");     
          properties.put("mail.smtp.port", "25");     
          properties.put("mail.smtp.username", user);     
          properties.put("mail.smtp.password", password);
          properties.put("mail.transport.protocol", "smtp"); 
  
          Session session = Session.getDefaultInstance(properties, null);      
  
          try             
          {         
              Message message = new MimeMessage(session);         
              message.setFrom(new InternetAddress(fromAddress));         
              message.setRecipients(Message.RecipientType.TO, InternetAddress.parse(toAddress));          
              message.setSubject("Email from our JAMEs");         
              message.setText("hiiiiii!!");         
              Transport.send(message);          
              System.out.println("Email sent");     
          }     
          catch (MessagingException e)     
          {        
              e.printStackTrace();     
          } 
          }
  }
  </code></pre>
  
  <p>Also test user is added in apache james having password test. Requesting you to kindly help me out in the same.</p>