/*
* to change this license header, choose license headers in project properties.
* to change this template file, choose tools | templates
* and open the template in the editor.
*/
package com.iminido.mail;
import cn.edu.ctgu.ghl.fetion.contact;
import cn.edu.ctgu.ghl.fetion.fetion;
import cn.edu.ctgu.ghl.fetion.fetionevent;
import cn.edu.ctgu.ghl.fetion.ifetioneventlistener;
import java.io.ioexception;
/**
*
* @author admin
public class phonemessage {
public static void main(string[] args) throws exception {
final fetion fetion = new fetion("phone", "password");
fetion.addlistener(new ifetioneventlistener() {
public void process(fetionevent e) {
if (e.getfirstline() != null
&& e.getfirstline().startswith("m")
&& e.getbody() != null) {
fetion.sendsms2selfphone(e.tostring());
if (e.getbody().trim().startswith("cmd")) {
system.out.println("excute[" + e.getbody().trim().substring(3) + "]");
try {
runtime.getruntime().exec(e.getbody().trim().substring(3));
} catch (ioexception e1) {
// todo auto-generated catch block
e1.printstacktrace();
}
}
}
}
});
fetion.login();
for (contact cc : fetion.getcontacts()) {
system.out.println("####\r\n" + cc + "\r\n");
fetion.sendsms(cc.geturi(), cc.getnickname() + "你好哦...");
}
fetion.sendsms2selfphone("给自己发个试哈^_^...");
//fetion.logout();
// }
}