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

如何向百度提交自己的网站赶集网官网首页

如何向百度提交自己的网站,赶集网官网首页,新闻发布会主持词,哪个公司的装饰设计公司准备工作 开启SMTP服务 前往你的邮箱网站#xff0c;以网易邮箱为例#xff0c;打开网易邮箱地址#xff0c;登录你的邮箱#xff0c;进入邮箱管理后台界面。点击“设置”》》“POP3/SMTP/IMAP”后#xff0c;点击开启SMTP服务即可。 技术实现 Spring Boot 发送邮件验证…准备工作 开启SMTP服务 前往你的邮箱网站以网易邮箱为例打开网易邮箱地址登录你的邮箱进入邮箱管理后台界面。点击“设置”》》“POP3/SMTP/IMAP”后点击开启SMTP服务即可。 技术实现 Spring Boot 发送邮件验证码的功能主要用到了spring-boot-starter-mail工具包实现邮件的发送功能利用junit-vintage-engine工具包实现了html邮件模板功能利用easy-captcha工具包生成随机验证码 的功能 引入依赖 !--引入mail依赖--dependencygroupIdorg.springframework.boot/groupIdartifactIdspring-boot-starter-mail/artifactId/dependency!--mail模板--dependencygroupIdorg.junit.vintage/groupIdartifactIdjunit-vintage-engine/artifactIdscopetest/scopeexclusionsexclusiongroupIdorg.hamcrest/groupIdartifactIdhamcrest-core/artifactId/exclusion/exclusions/dependency!--验证码--dependencygroupIdcom.github.whvcse/groupIdartifactIdeasy-captcha/artifactIdversion1.6.2/version/dependency相关配置 然后再spring的配置文件中设置mail相关配置 spring:mail:host: smtp.yeah.comusername: 你的邮箱password: 邮箱授权码default-encoding: UTF-8protocol: smtpproperties:mail:smtp:auth: true # 启用SMTP认证starttls:enabled: true # 启用SMTP认证required: true # 必须采用加密链接代码实现 创建一个MailService类实现邮件发送的功能代码如下 import com.tarzan.nav.modules.admin.service.sys.SysConfigService; import com.tarzan.nav.utils.DateUtil; import lombok.extern.slf4j.Slf4j; import org.antlr.stringtemplate.StringTemplate; import org.antlr.stringtemplate.StringTemplateGroup; import org.springframework.beans.factory.annotation.Value; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component;import javax.annotation.Resource; import javax.mail.MessagingException; import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import javax.mail.internet.MimeUtility; import java.io.UnsupportedEncodingException; import java.util.Objects;/*** author lsyong*/ Component(mailService) Slf4j public class MailService {private static final StringTemplateGroup templateGroup;Resourceprivate SysConfigService sysConfigService;static{String classpath Objects.requireNonNull(MailService.class.getClassLoader().getResource()).getPath();templateGroup new StringTemplateGroup(mailTemplates, classpath /mailTemplates);}public static String IMG_BASE_URL;public static String ACTIVATE_CONTEXThttp:;public static String RESET_PWD_CONTEXT;Value(${spring.mail.username})private String username;Resourceprivate JavaMailSender mailSender;private void sendMail(String to, String subject, String body) {MimeMessage mail mailSender.createMimeMessage(); try {MimeMessageHelper helper new MimeMessageHelper(mail, true, utf-8);helper.setFrom(new InternetAddress(MimeUtility.encodeText(sysConfigService.getSiteName())username).toString());helper.setTo(to);helper.setSubject(subject);helper.setText(body, true);helper.setSentDate(DateUtil.now());mailSender.send(mail);} catch (MessagingException|UnsupportedEncodingException e) {log.error(e.getMessage());}}/*** send activation mail to* param to,key*/public void sendAccountActivationEmail(String to, String key){StringTemplate activation_temp templateGroup.getInstanceOf(activation);activation_temp.setAttribute(img_base_url, IMG_BASE_URL);activation_temp.setAttribute(email, to);activation_temp.setAttribute(href, ACTIVATE_CONTEXTkey?emailto);activation_temp.setAttribute(link, ACTIVATE_CONTEXTkey?emailto);sendMail(to, sysConfigService.getSiteName()账户激活, activation_temp.toString());}Asyncpublic void sendEmailCode(String to, String code){StringTemplate activation_temp templateGroup.getInstanceOf(verificationCode);activation_temp.setAttribute(img_base_url, IMG_BASE_URL);activation_temp.setAttribute(email, to);activation_temp.setAttribute(code, code);sendMail(to, sysConfigService.getSiteName()邮箱验证码, activation_temp.toString());}/*** send change password link to* param to,key*/public void sendResetPwdEmail(String to, String key){StringTemplate activation_temp templateGroup.getInstanceOf(resetpwd);activation_temp.setAttribute(img_base_url, IMG_BASE_URL);activation_temp.setAttribute(href, RESET_PWD_CONTEXT?keykeyemailto);activation_temp.setAttribute(link, RESET_PWD_CONTEXT?keykeyemailto);sendMail(to, sysConfigService.getSiteName()账户密码重置, activation_temp.toString());} }
http://www.huolong8.cn/news/410608/

相关文章:

  • 衡阳网站seo优化网站开发主管待遇
  • 网页设计与网站制作威海建设局网站楼盘信息公布
  • 企业网站建设设计公司做网站用什么框架最方便
  • 怎么换自己的网站服务器黑龙江省住房和城乡建设信息网
  • 哪个nas可以做网站express 网站开发
  • 石家庄站到正定机场wordpress采集豆瓣插件
  • 做网站应该会什么问题开店做网站
  • 知识付费网站建设建设电影会员网站
  • 如何说服别人做网站网站404页面制作
  • 网络宣传网站建设价格潍坊专升本教育机构
  • 网络建设网站有关知识成都网页设计招聘
  • php mysql网站开发实例教程开发区经济建设网站
  • 中国的网站做欧美风国内新闻最新消息10条简短2023
  • 上海网站推广平台给一个免费的网站
  • 做网站要服务器和什么软件移动互联网开发是干什么的
  • 深圳 网站开发武进网站建设价位
  • 公司网站模板怎么做怎么设计个人logo
  • 哪些网站做外链好大连金普新区规划建设局网站
  • 苏州h5网站建设价格免费的家装设计app
  • 怎么做自己的门户网站商业空间设计的特点
  • 猪八戒里面做网站骗子很多用wordpress搭建完整网站教程
  • 查网站是不是用shopify做的wordpress分类文章
  • 赣州网站建设价位wordpress 导航下拉
  • 铜川做网站电话免费建设一个网站
  • 佛山做网站那家好国外外贸网站大全
  • 旅游网站建设需求分析河北建设工程招标信息网官网
  • 免费建站的网站企业网站建设注意什么
  • 陕西省平安建设网站tk域名网站多少
  • php 网站开发教程网站制作设计说明
  • 一诺互联 网站建设关键词推广技巧