Send SMS Text Messages Worldwide from any Computer - Login to iPiPi Personal Accounts Corporate SMS Partners About Contact

Send Text Messages Using Java

Text messages - Send SMS - International Messaging Service

Example code to send text messages written in Java.
Must Download
1.  mail.jar from JavaMail at

2. activation.jar at
and set classpath to the location where the files are stored. This code is provided as sample only.

import java.util.Properties;
import java.util.Date;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

public class SMTPSend {

    public SMTPSend() {

    public void msgsend() {
        String username = "YoureIPIPIUsername";
        String password = "YourPassword";
        String smtphost = "";
        String compression = "Compression Option goes here - find out more";
        String from = "";
        String to = "";
        String body = "Your Message";
        Transport tr = null;

        try {
         Properties props = System.getProperties();
         props.put("mail.smtp.auth", "true");

         // Get a Session object
         Session mailSession = Session.getDefaultInstance(props, null);

         // construct the message
         Message msg = new MimeMessage(mailSession);

         //Set message attributes
         msg.setFrom(new InternetAddress(from));
         InternetAddress[] address = {new InternetAddress(to)};
         msg.setRecipients(Message.RecipientType.TO, address);
         msg.setSentDate(new Date());

         tr = mailSession.getTransport("smtp");
         tr.connect(smtphost, username, password);
         tr.sendMessage(msg, msg.getAllRecipients());
         } catch (Exception e) {

      public static void main(String[] argv) {
          SMTPSend smtpSend = new SMTPSend();



Home - Contact Us - Privacy Policy - Terms of Service - Help - Links - Site Map
International SMS - SMS - SMS Messaging - Text Message - Send SMS - Email to SMS - WEB to SMS
Copyright 2001-2007 Upside Wireless Inc. All rights reserved