Moyosoft Products | Services | Download | Contact us    
Java Bridge to Exchange
import com.moyosoft.exchange.*;
import com.moyosoft.exchange.mail.*;

public class SendMail
{
  public static void main(String[] argsthrows ExchangeServiceException
  {
    // To provide hostname and credentials information, use:
    // Exchange exchange = new Exchange("hostname", "username", "password");
    Exchange exchange = ExchangeConnectionDialog.display();

    if(exchange == null)
    {
      return;
    }

    // Create a new e-mail:
    ExchangeMail mail = exchange.createMail();

    // Set the recipient, subject and body:
    mail.setToRecipient("info@moyosoft.com");
    mail.setSubject("Test message");
    mail.setBody("Hello. There's a message sent from Java.");
    
    // Send the message:
    mail.send();
  }
}