邮件接口调用
来源:互联网 发布:netflix 获奖算法 编辑:程序博客网 时间:2024/05/24 06:15
用axis2本地生成文件后调用就行,xmlbeans和abd都可以import org.slf4j.Logger;import org.slf4j.LoggerFactory;import org.tempuri.SendMailCDocument;import org.tempuri.SendMailCResponseDocument;import java.rmi.RemoteException;/** * @Author: zhangshulong * @Description: * @Date: Created in 17:25 2016/11/24 */public class EmailUtil { private static final Logger LOGGER = LoggerFactory.getLogger(EmailUtil.class); /** * * @param address 邮箱地址 * @param title 邮件主题 * @param content 邮件内容 * @param nickName 发件人 * @return */ public static String sendEmail(String address, String title, String content, String nickName) { com.opple.sendmail.ServiceStub stub = null; SendMailCDocument sendMailCDocument = null; SendMailCDocument.SendMailC sendMailC = null; String xmlStr = null; String aa = null; String result = null; String msg = null; try { sendMailCDocument = SendMailCDocument.Factory.newInstance(); sendMailC = sendMailCDocument.addNewSendMailC(); sendMailC.setMTo(address); sendMailC.setMSubJect(title); sendMailC.setMBoday(content); sendMailC.setMSysType(nickName); stub = new com.opple.sendmail.ServiceStub(); SendMailCResponseDocument sendMailCResponseDocument = stub.sendMailC(sendMailCDocument); xmlStr = sendMailCResponseDocument.xmlText(); aa = xmlStr.split("<SendMailCResult>")[1]; msg = aa.split("</SendMailCResult>")[0]; if ("pass".equals(msg)) { result = "发送成功"; } else { result = "发送失败"; } } catch (RemoteException e) { LOGGER.error("e", e); result = "发送失败"; } catch (Exception e) { LOGGER.error("e", e); result = "发送失败"; } return result; }}
0 0
- 邮件接口调用
- java邮件接口调用
- 调用邮件接口发送邮件 调用短信接口发送短信
- python调用第三方邮件接口
- 基于两个项目 之间的RabbitMQ 发送和接收,并调用邮件接口,发送邮件
- iOS调用发邮件,打电话,发短信,自带浏览器接口的介绍
- Perl中调用路径接口(返回值为json)发送邮件
- SAP中用json数据格式调用http接口发送短信邮件案例
- SAP中用json数据格式调用http接口发送短信邮件案例
- Liferay:邮件送信接口
- 邮件送信接口
- .NET发送邮件接口
- java邮件接口实现
- PHP-邮件发送接口
- 接口 调用
- 接口调用
- 调用接口
- 调用接口
- RK-3288_Android5.1_BluetoothSettings
- AutoCompleteTextView输入汉字拼音首字母实现过滤提示(支持多音字)2
- Android之---ContentProvider介绍
- jquery 设置style:display的方法
- 用 Flask 来写个轻博客 (15) — M(V)C_实现博文页面评论表单
- 邮件接口调用
- Hibernate 框架对象/关系(ORM)映射文件
- myEclipse2014、JAX-WS、tomcat 配置webservice
- 输入循环在什么情况下结束,while(cin>>word) 类型?
- 手机存储1
- ubuntu server 16.04 配置网络
- 自定义数字键盘
- 如何通过adb command去控制MTKLogger 开关
- nsfw