Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package msgme;
- import org.jivesoftware.smack.Chat;
- import org.jivesoftware.smack.ChatManager;
- import org.jivesoftware.smack.ConnectionConfiguration;
- import org.jivesoftware.smack.SASLAuthentication;
- import org.jivesoftware.smack.XMPPConnection;
- /**
- *
- * @author quarter
- */
- public class MsgMe {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) throws Exception {
- // TODO code application logic here
- String user = "queijof@gmail.com";
- String pass = "queijinho";
- ConnectionConfiguration cc = new ConnectionConfiguration("talk.google.com", 5222, "gmail.com");
- XMPPConnection connection = new XMPPConnection(cc);
- connection.connect();
- SASLAuthentication.supportSASLMechanism("PLAIN", 0);
- connection.login(user, pass);
- ChatManager chatmanager = connection.getChatManager();
- Chat chat = chatmanager.createChat("marcoandredinis@gmail.com", null);
- chat.sendMessage("Hi Tom!");
- }
- }
Add Comment
Please, Sign In to add comment