Java代码
-
/**////
- /// 注册时发送用户帐 跟密码
- ///
- /// 用户注册邮箱
- /// 用户名
- public bool Register(string receiver, string username, string password)
- …{
- //System.Net.Mail.SmtpClient mail = new System.Net.Mail.SmtpClient();
- //邮件发送时请确认服务的杀毒软件因素
- System.Net.Mail.SmtpClient client;
- client = new System.Net.Mail.SmtpClient(“smtp.163.com”);
- client.Timeout = 60000;
- //client.UseDefaultCredentials = false;
- client.UseDefaultCredentials = true;
- client.Credentials = new System.Net.NetworkCredential(“abc@163.com”, “123456”);
- client.DeliveryMethod = System.Net.Mail.SmtpDeliveryMethod.Network;
- System.Net.Mail.MailMessage message = new System.Net.Mail.MailMessage();
- message.SubjectEncoding = System.Text.Encoding.UTF8;
- message.BodyEncoding = System.Text.Encoding.UTF8;
- message.From = new System.Net.Mail.MailAddress(“abc@163.com”, “Andy Lu”, System.Text.Encoding.UTF8);
- message.To.Add(new System.Net.Mail.MailAddress(receiver, username, System.Text.Encoding.UTF8));
- message.IsBodyHtml = false;
- message.Subject = “用户注册信息(软件项目 )”;
- message.Body = username + “:您好! 欢迎您光临软件项目 [http://www.softprj.cn]!您注册的用户名是:” + username + “;密码是:” + password + “。 点此进入软件项目 :http://www.soft.cn”;
- try
- …{
- client.Send(message);
- return true;
- }
- catch
- …{
- return false;
- }
- }
看了无数篇,检查了N次,原来是VirusScan 惹得祸!
关掉其“按访问扫描”一切OK
参考此篇http://blog.csdn.net/mengyao/archive/2007/08/16/1745836.aspx
转自:http://blog.csdn.net/mengyao/archive/2007/08/15/1743427.aspx
http://shirlly.iteye.com/blog/346025
文章知识点与官方知识档案匹配,可进一步学习相关知识Java技能树首页概览92511 人正在系统学习中
声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!