- 浏览: 122850 次
- 性别:
文章分类
最新评论
use org.apache.commons.net.smtp.AuthenticatingSMTPClient
private void sendLogByEmail(){
String sender = "mxy200@163.com";
String recipient = "mxy200@126.com";
String sendMsg = getData();
if(sendMsg == null)
return;
try {
AuthenticatingSMTPClient client = new AuthenticatingSMTPClient();
//client.addProtocolCommandListener(new PrintCommandListener(
//new PrintWriter(System.out), true));
client.connect("smtp.163.com");
int reply = client.getReplyCode();
if(!SMTPReply.isPositiveCompletion(reply)) {
client.disconnect();
return;
}
client.elogin();
client.auth(AuthenticatingSMTPClient.AUTH_METHOD.LOGIN, sender,"20142924");
client.setSender(sender);
client.addRecipient(recipient);
SimpleSMTPHeader header = new SimpleSMTPHeader(sender, recipient, "vlook log,"+CacheService.User_Id);
Writer writer = client.sendMessageData();
if (writer != null)
{
writer.write(header.toString());
writer.write("\n"+SkinDef.CLIENT_IDENTIFIER+","+SkinDef.APP_SUB+","+Config.BUILD_VER);
writer.write(" net="+NetManager.getTelNetWrokType());
if(NetManager.mNetType == Define.NET_PROXY)
writer.write("\nproxy net,host:"+NetManager.mProxyHost+",port:"+NetManager.mProxyPort);
writer.write(sendMsg);
writer.close();
client.completePendingCommand();
}
client.logout();
client.disconnect();
}
catch (Exception e) {
e.printStackTrace();
}
}
private void sendLogByEmail(){
String sender = "mxy200@163.com";
String recipient = "mxy200@126.com";
String sendMsg = getData();
if(sendMsg == null)
return;
try {
AuthenticatingSMTPClient client = new AuthenticatingSMTPClient();
//client.addProtocolCommandListener(new PrintCommandListener(
//new PrintWriter(System.out), true));
client.connect("smtp.163.com");
int reply = client.getReplyCode();
if(!SMTPReply.isPositiveCompletion(reply)) {
client.disconnect();
return;
}
client.elogin();
client.auth(AuthenticatingSMTPClient.AUTH_METHOD.LOGIN, sender,"20142924");
client.setSender(sender);
client.addRecipient(recipient);
SimpleSMTPHeader header = new SimpleSMTPHeader(sender, recipient, "vlook log,"+CacheService.User_Id);
Writer writer = client.sendMessageData();
if (writer != null)
{
writer.write(header.toString());
writer.write("\n"+SkinDef.CLIENT_IDENTIFIER+","+SkinDef.APP_SUB+","+Config.BUILD_VER);
writer.write(" net="+NetManager.getTelNetWrokType());
if(NetManager.mNetType == Define.NET_PROXY)
writer.write("\nproxy net,host:"+NetManager.mProxyHost+",port:"+NetManager.mProxyPort);
writer.write(sendMsg);
writer.close();
client.completePendingCommand();
}
client.logout();
client.disconnect();
}
catch (Exception e) {
e.printStackTrace();
}
}
发表评论
-
react-native github 中的eXamples中的示例工程运行方法。
2016-05-13 17:35 6121 从github中 https://github.com/ ... -
android textureView的重大进步
2016-04-13 17:01 2121android TextureView 的出现解决了几大问 ... -
android 陀螺器,加速度感应测试数据
2016-04-13 08:52 899加速度传感器又叫G-sensor,返回x、y、z三轴的 ... -
android.permission.SYSTEM_ALERT_WINDOW
2016-04-12 16:05 774此权限用实现 在android手机上出现的浮在窗口上的快捷 ... -
fyuse 3d拍摄
2016-04-12 14:44 597fyuse : 附件为反编译的dex文件. -
diceplayer android版本可以实现 快速播放功能
2016-04-06 17:37 629android 版本的diceplayer 可以实现快速播放 ... -
anroid 各种感应介绍
2016-04-06 11:41 353http://blog.csdn.net/mad1989/ar ... -
videoview 刷新不及时的问题.
2016-03-29 13:17 996androi videoview 在做开发的时候, 前个页面 ... -
android 解析带有_的 http url域名,出现解析错误的问题
2016-03-29 13:13 1549在 android中 访问带有_ 的域名的时候,例如js_s ... -
android mediaplayer 播放错误 -32
2016-03-23 14:33 3发现android4.4 meizu mx4pro 出现播放错 ... -
android 头像圆圈显示
2016-03-16 17:22 671public Bitmap toRoundBitmap(Bi ... -
android 获取签名 及其摘要
2016-03-16 14:17 731http://www.cnblogs.com/sunzn/ar ... -
android 自定义无黑边对话框输入框无法输入的问题
2016-03-16 11:25 709http://wbj05791467.blog.163.com ... -
andorid textview link text
2016-02-19 18:53 606android 在textview 解析自定义各种链接url ... -
不应该建立所谓的下来刷新webview
2016-02-18 10:23 656本来以为做一个下拉刷新功能的 webview 是一个好的功 ... -
在listview 滚动列表中实现 视频播放
2016-02-13 19:23 980http://finalshares.com/read-698 ... -
okhttp 详解文章
2015-12-31 17:51 725http://www.cnblogs.com/ct2011/p ... -
android so常识
2015-12-31 12:43 362http://www.kejik.com/article/21 ... -
android studio 新建工程出现的问题解决
2015-12-31 10:48 827解决Android中No resource found th ... -
GitHub 上最火的40个Android 开源
2015-09-25 10:56 749http://www.360doc.com/content/1 ...
相关推荐
通过对“基于SMTP协议的邮件发送客户端程序”的系统分析、系统设计、编码、调试等工作的实践,了解基于TCP/IP协议的网络编程的一般设计和实现思路,熟悉和掌握软件设计和实现的一般方法,深入了解邮件传输协议的基本...
基于邮件交换(MX)与SMTP协议发送邮件,可以无须SMTP服务器中转直接将E-Mail电子邮件发送到对方邮箱,代码中提供了网卡信息获取类,可以获取本机IP地址、子网掩码、DNS、Wins、网卡MAC地址等相关信息;还提供了SMTP协议...
visual c++利用SMTP协议发送邮件支持附件 vc email attatchment
C# 使用SMTP协议 根据发件人邮箱服务器名和邮箱名给收件人 发送邮件
用vs编写的带有界面的邮件发送端,可以上传附件,支持163邮箱,别的没试
POP3: 1.支持本地缓存最新的3封邮件。 2.正常解析出收件人、发件人、主题、日期、邮件内容。 3.正常解析无格式纯文本,支持中文、英文和中英... SMTP: 1.支持发送中英文的邮件。 2.支持给多人发送邮件,每个收件人之
使用SMTP协议发送电子邮件.rar使用SMTP协议发送电子邮件.rar
实验报告请私聊-升级版见其它资源 关于要求:编程实现通过用户界面,用户登录信箱认证过程(含base64方式...这意味着除了使用SMTP协议发送邮件外,还需设计使用POP3协议接收邮件,在接收的时候采用黑白名单过滤的功能。
C# 基于SMTP协议和SOCKET发送邮件及附件。 在WIN7的VS2010环境下编译测试OK。
基于SMTP协议的邮件发送客户端程序。 基于SMTP协议的邮件发送客户端程序。
JAVA100例之实例45 使用SMTP协议发送邮件
SMTP协议发送邮件.调试过能使用.有必要联系我。。
摘要:C#源码,网络相关,SMTP,发送邮件 C#使用SMTP协议发送电子邮件,超简单的C#学习实例,想了解在C#下使用SMTP协议的朋友,可以下载此程序代码参考。
C语言实现基于SMTP协议发送邮件.zip
利用socket mfc实现邮件发送smtp协议,在桌面发送你的邮件!资源包括可执行文件和设计报告,仅供参考!
smtp发送邮件的客户端实现,用c#中的异步方式来实现,课堂上经过验证了的代码
Python源码Python 如何使用SMTP协议为注册用户发送邮件 Python源码Python 如何使用SMTP协议为注册用户发送邮件 Python源码Python 如何使用SMTP协议为注册用户发送邮件 Python源码Python 如何使用SMTP协议为注册用户...
java socket 实现SMTP协议 发送邮件.docx
Java Socket 实现SMTP邮件发送,支持SSL/TSL
邮件发送客户端