当前位置: 首页 > news >正文

完全免费建站系统手机网站制作方案

完全免费建站系统,手机网站制作方案,wordpress style标签,商务网站建设的可行性分析包括目录 引出springboot整合email配置邮箱导入依赖application.yml配置email业务类测试类 springboot整合阿里云短信服务申请阿里云短信服务测试短信服务获取阿里云的accessKeyspringboot整合阿里云短信导包工具类 总结 引出 1.springboot整合email#xff0c;qq邮箱#xff0c;… 目录 引出springboot整合email配置邮箱导入依赖application.yml配置email业务类测试类 springboot整合阿里云短信服务申请阿里云短信服务测试短信服务获取阿里云的accessKeyspringboot整合阿里云短信导包工具类 总结 引出 1.springboot整合emailqq邮箱特点免费 2.springboot整合阿里短信服务100条免费 3.后续应用可以用在登陆业务上比如邮箱登陆短信登陆 springboot整合email 配置邮箱 登录邮箱服务器 登录QQ邮箱 后面要用到这个授权码key 导入依赖 !-- qq邮箱--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-mail/artifactId/dependencyapplication.yml配置 email业务类 接口 package com.tianju.auth.service;public interface IEmailService {/*** 发送右键* param to 邮件接收方* param subject 邮件主题* param content 邮件内容*/void sendEmail(String to,String subject,String content); } 实现 package com.tianju.auth.service.impl;import com.tianju.auth.service.IEmailService; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.SimpleMailMessage; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.stereotype.Service;import javax.annotation.Resource; import java.util.Date;Service Slf4j public class EmailServiceImpl implements IEmailService {Value(${spring.mail.username})private String from;Resourceprivate JavaMailSender javaMailSender;Overridepublic void sendEmail(String to, String subject, String content) {SimpleMailMessage mailMessage new SimpleMailMessage();mailMessage.setSubject(subject);mailMessage.setTo(to);mailMessage.setText(content);mailMessage.setSentDate(new Date());mailMessage.setFrom(from);javaMailSender.send(mailMessage);log.debug(在{}发送一条邮件{}给{},mailMessage.getSentDate(),mailMessage.getText(),mailMessage.getTo());} }测试类 package com.tianju.auth.service.impl;import com.tianju.auth.service.IEmailService; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;import javax.xml.ws.soap.Addressing;import java.util.UUID;import static org.junit.Assert.*;SpringBootTest RunWith(SpringJUnit4ClassRunner.class) public class EmailServiceImplTest {Autowiredprivate IEmailService emailService;Testpublic void sendEmail() {emailService.sendEmail(xxxxqq.com, 我是老王我在测试代码, UUID.randomUUID().toString());} }springboot整合阿里云短信服务 申请阿里云短信服务 短信服务 (aliyun.com) 测试短信服务 进行测试 调用结果 成功接收短信 获取阿里云的accessKey springboot整合阿里云短信 导包 !-- 阿里云短信验证码相关包--dependencygroupIdcom.aliyun/groupIdartifactIdaliyun-java-sdk-core/artifactIdversion4.5.3/version/dependency工具类 package com.tianju.auth.util;import com.aliyuncs.CommonRequest; import com.aliyuncs.CommonResponse; import com.aliyuncs.DefaultAcsClient; import com.aliyuncs.IAcsClient; import com.aliyuncs.exceptions.ClientException; import com.aliyuncs.exceptions.ServerException; import com.aliyuncs.http.MethodType; import com.aliyuncs.profile.DefaultProfile; import net.minidev.json.JSONObject;import java.util.HashMap; import java.util.Map; import java.util.Random;public class SMSUtil {private static String AccessIdKey 获取的keyID;private static String AccessKeySecret 获取的KeySecret;public static void send(String tel,String code) {DefaultProfile profile DefaultProfile.getProfile(cn-hangzhou,AccessIdKey, //AccessIdKeyAccessKeySecret); //AccessKey SecretIAcsClient client new DefaultAcsClient(profile);CommonRequest request new CommonRequest();request.setSysMethod(MethodType.POST);//下面这3个不要改动request.setSysDomain(dysmsapi.aliyuncs.com);request.setSysVersion(2017-05-25);request.setSysAction(SendSms);//接收短信的手机号码request.putQueryParameter(PhoneNumbers,tel);//此处写电话号码//短信签名名称request.putQueryParameter(SignName,阿里云短信测试);//短信模板IDrequest.putQueryParameter(TemplateCode,SMS_154950909);//短信模板变量对应的实际值 ${code} 中的值MapString,String param new HashMap(2);param.put(code, String.valueOf(code)); //写入的短信内容,验证码request.putQueryParameter(TemplateParam, JSONObject.toJSONString(param));try {CommonResponse response client.getCommonResponse(request);System.out.println(response.getData());} catch (ServerException e) {e.printStackTrace();} catch (ClientException e) {e.printStackTrace();}}public static void main(String[] args) {int i new Random().nextInt(80000) 10000;System.out.println(i); // 35054SMSUtil.send(xxxx, 392712);}} 总结 1.springboot整合emailqq邮箱特点免费 2.springboot整合阿里短信服务100条免费 3.后续应用可以用在登陆业务上比如邮箱登陆短信登陆
http://www.hkea.cn/news/14354868/

相关文章:

  • 高新网站设计找哪家网站建设 常见问题
  • 网站备案的时候可以做网站吗上海建设工程检测登记的网站
  • 企业如何做网站收款免费咨询律师问题
  • 天河移动网站建设泰安网签查询系统
  • 全国购网站建设网页小游戏在线玩无需登录
  • 眉县网站开发做网站页面的框架
  • 东莞网站优化教程建筑公司网站内容
  • 网站项目建设的组织机构网站建设公司新排行榜
  • 鸿梦社区wordpress搜索引擎优化工作主要做好哪些方面
  • 时尚网站模板代码毕业设计做网站难吗
  • 珠海市外贸网站建设公司wordpress中文语言包
  • 免费自己做网站手机中国商务平台
  • 北京网站设计制作关键词深圳品牌网站设计电话
  • 著名网站用什么语言做后台有什么好用的搜索引擎
  • 一尊网 又一个wordpress站点用servlet做外卖网站
  • 服务器怎么做网站2017wordpress整站源码
  • 平面设计师参考网站企业电子商务网站建设的最终目的
  • pc网站手机版开发网页制作模板菜鸟
  • 营销型网站建设公司外链怎么做
  • 单页 网站模板xampp wordpress linux
  • 中山seo建站温州建网站公司哪家好
  • 深圳建设银行分行网站wordpress如何恢复默认主题
  • 京东商城官方网站金融网站建设内容
  • 网站设计照着做 算侵权吗软件项目管理是做什么
  • 网站建设服务合同协议咸宁做网站的公司那家便宜
  • 行业门户网站设计网站建设年费
  • 电影网站标题怎么做流量多139邮箱网页版登录
  • 如何做网站的关键词支付网站建设费
  • 深圳网页制作案例seo咨询
  • 网站 制作登录建行企业网上银行下载