Skip to content

Commit

Permalink
1
Browse files Browse the repository at this point in the history
  • Loading branch information
nwsuafzq committed Jul 20, 2017
1 parent aecd923 commit 843cf87
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 55 deletions.
10 changes: 10 additions & 0 deletions README.md
Expand Up @@ -27,6 +27,16 @@ public class MailSendUtil {

-----

手机验证码发送类 用的是某平台的API,注册后免费送50次,你可以根据自己需要去注册一个或者去掉这个功能。
SendSMSAction.java中:
```java
NameValuePair[] data = {//提交短信
new NameValuePair("account", ""), //查看用户名请登录用户中心->验证码、通知短信->帐户及签名设置->APIID
new NameValuePair("password", ""), //查看密码请登录用户中心->验证码、通知短信->帐户及签名设置->APIKEY
```

-----

配置文件SpringMVC.xml中配置数据源也要根据你的数据库设置来进行相应更改:
```
<!-- 配置数据源 -->
Expand Down
4 changes: 2 additions & 2 deletions src/cn/edu/nwsuaf/controller/register/SendSMSAction.java
Expand Up @@ -32,8 +32,8 @@ public void sendSMS(String mobile,HttpServletRequest request,HttpServletResponse

String content = new String("您的验证码是:" + mobile_code + "。请不要把验证码泄露给其他人。");
NameValuePair[] data = {//提交短信
new NameValuePair("account", "C17586719"), //查看用户名请登录用户中心->验证码、通知短信->帐户及签名设置->APIID
new NameValuePair("password", "51d94112d6bc149aaf5397f5eb218a1b"), //查看密码请登录用户中心->验证码、通知短信->帐户及签名设置->APIKEY
new NameValuePair("account", ""), //查看用户名请登录用户中心->验证码、通知短信->帐户及签名设置->APIID
new NameValuePair("password", ""), //查看密码请登录用户中心->验证码、通知短信->帐户及签名设置->APIKEY
//new NameValuePair("password", util.StringUtil.MD5Encode("密码")),
new NameValuePair("mobile", mobile),
new NameValuePair("content", content),
Expand Down
10 changes: 5 additions & 5 deletions src/cn/edu/nwsuaf/util/MailSendUtil.java
@@ -1,4 +1,4 @@
package cn.edu.nwsuaf.util;
package cn.edu.nwsuaf.util;

import javax.mail.*;
import javax.mail.internet.InternetAddress;
Expand All @@ -18,10 +18,10 @@
* 2017-6-23
*/
public class MailSendUtil {
private final static String host = "smtp.sina.com"; // 163的服务器
private final static String formName = "zhangq_nwafu@sina.com";// 你的邮箱
private final static String password = "zhangqiong2008"; // 授权码
private final static String replayAddress = "zhangq_nwafu@sina.com"; // 你的邮箱
private final static String host = "smtp.sina.com"; // sina的服务器
private final static String formName = "";// 你的邮箱
private final static String password = ""; // 授权码
private final static String replayAddress = ""; // 你的邮箱

public static void sendHtmlMail(MailInfo info) throws Exception {
info.setHost(host);
Expand Down
48 changes: 0 additions & 48 deletions src/cn/edu/nwsuaf/util/MailUtil.java

This file was deleted.

0 comments on commit 843cf87

Please sign in to comment.