📄 sendsimple.java
字号:
package mms;import java.io.File;import java.net.URL;import com.objectxp.mms.MMSAddress;import com.objectxp.mms.MMSService;import com.objectxp.mms.MMSServiceFactory;import com.objectxp.mms.message.MMSMessage;import com.objectxp.mms.message.SMILMessage;public class SendSimple{ public static void main(String[] args) throws Exception { // initialize Service MMSServiceFactory factory = MMSServiceFactory.createFactory(new File("/path/to/jsms.conf")); MMSService mmsService = factory.getDefaultService(); // load smilDocument from the given URL URL url = new URL("file:///path/to/your/smil.xml"); MMSMessage msg = new SMILMessage(url); msg.addTO(new MMSAddress(MMSAddress.TYPE_PLMN, "555123456")); // send Message try { mmsService.connect(); mmsService.send(msg); System.out.println("Message sent succesfully."); }catch (Exception e){ System.err.println("could not send Message:"+ e); e.printStackTrace(); } finally{ mmsService.disconnect(); } }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -