• 回答数

    5

  • 浏览数

    157

辉煌人生
首页 > 公务员考试 > 公务员考试邮箱怎么激活

5个回答 默认排序
  • 默认排序
  • 按时间排序

星耀夜阑

已采纳

您好,华图教育为您服务。重新申请邮箱,重新报名,邮箱无法激活申述的话基本上要2天时间。建议你联系北京考区报名确认咨询电话。如有疑问,欢迎向华图教育企业知道提问。

公务员考试邮箱怎么激活

281 评论(9)

又肥又馋的兔子

您好,不知您的问题是否已解决。通常这种情况,退出系统,关闭浏览器重新登陆下,可能是网络造成的浏览器卡了造成的,基本跟外在没问题。希望有所帮助。

80 评论(11)

美林小姐

Copyright © 1999-2020, CSDN.NET, All Rights Reserved程序员必备的浏览器插件 登录龙晓朱关注激活注册邮箱 原创2014-12-02 12:17:01 2点赞 龙晓朱 码龄6年关注一、目标对注册时填写的邮箱进行激活,当注册成功以后,会显示一个前往激活邮箱的按钮,点击即可登录邮箱激活.情况1:修改了邮箱账号或者激活码,激活失败error;情况2:在指定时间内未激活,激活失败,重新获取激活码再次激活error;情况3:在符合条件的情况下,连续两次激活,第二次激活无效,重复激活error;情况4:按要求操作,激活成功success.二、业务流程图:三、实现步骤:1 添加maven依赖,项目由maven管理 javax.mail mail 1.4.1 2 继承Authenticator类编写发送消息的方法,附注释package com.changhong.camp.cmms.util; import javax.mail.*;import javax.mail.internet.InternetAddress;import javax.mail.internet.MimeMessage;import java.util.Date;import java.util.Properties; /** * Created by on 2014/11/28. * 这里为了方便起见,将发送邮件的方法封装在这个授权认证的类里。 * sendEmailActivationCode(String uuid, String email)方法就是向指定的收件箱email发送随机激活码uuid。 */public class EmailAuthenticator extends Authenticator { private String username; private String password; public EmailAuthenticator(String username, String password) { this.username = username; this.password = password; } @Override protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(username, password); } /** * 发送邮件的方法 * * @param uuid 发送随机激活码 * @param email 目标邮箱地址 */ public static void sendEmailActivationCode(String uuid, String email) { //todo /*初始化一个发件人*/ /*发件人邮箱账号*/ String username = ""; /*发件人邮箱密码*/ String password = "123456"; /*构造一个已授权认证的发件人对象*/ Authenticator authenticator = new EmailAuthenticator(username, password); /*action代表的是动作,即用户点击邮箱的超链接所发送的请求,包括请求服务器controller的方法,并且携带两个参数*/ String action = "http://localhost:8080/developer/active/email?email=" + email + "&code=" + uuid; /*构造一个包含激活邮箱动作的超链接*/ String url = "" + action + ""; /*具体的邮件内容*/ String msg = "请在30分钟内点击链接激活邮箱:" + url; /*设置发送方服务器参数,163邮箱服务器是smtp.163.com,其他邮箱可查阅官方文档。*/ Properties props = new Properties(); props.setProperty("mail.smtp.host", "smtp.163.com"); props.setProperty("mail.smtp.auth", "true"); javax.mail.Session session = javax.mail.Session.getDefaultInstance(props, authenticator);// session.setDebug(true); try { /*构造一个Address发件人*/ Address from = new InternetAddress(username); /*构造一个Address收件人*/ Address to = new InternetAddress(email); /*构造一个电子邮件对象 *MimeMessage参考博客: */ MimeMessage mimeMessage = new MimeMessage(session); /*设置消息发送者*/ mimeMessage.setFrom(from); /*邮件主题*/ mimeMessage.setSubject("邮箱激活"); /*邮件发送日期*/ mimeMessage.setSentDate(new Date()); /*邮件的内容以及内容的类型和编码*/ mimeMessage.setContent(msg, "text/html;charset=utf-8"); mimeMessage.setRecipient(Message.RecipientType.TO, to); /*执行发送邮件*/ Transport.send(mimeMessage); } catch (MessagingException e) { e.printStackTrace(); } }}3 在注册的时候调用发送邮件的方法并将随机激活码存入到数据库EmailAuthenticator.sendEmailActivationCode(uuid, userDto.getEmail());4 当发送激活码以后,假如用户没有即使去激活,在将来激活的时候需要再次获取激活码,新加一个方法用来再次发送激活码/** * @param email 接收激活链接的邮箱 * @return */ @RequestMapping(value = "active/make", method = RequestMethod.POST) @ResponseBody public ResponseEntity makeActivationCode(@RequestParam(value = "email") String email) { try { UserDto userDto = developerService.findByEmail(email); String uuid = StringUtils.generateUuidString(); userDto.setEmailActivationCode(uuid); developerService.update(userDto); EmailAuthenticator.sendEmailActivationCode(uuid, userDto.getEmail()); return new ResponseEntity(null, HttpStatus.OK); } catch (CoreException e) { e.printStackTrace(); return new ResponseEntity(null, HttpStatus.BAD_REQUEST); } }5 当用户登陆邮箱点击激活超链接时会以get方式请求服务器,服务器的激活处理用户前往邮箱查看邮件,点击超链接发送请求携带的参数为用户邮箱账号和服务器发送的激活码,请求发送至第5步。不同情况会转到不同的页面。/** * 处理用户点击链接后的激活动作 * * @param email 激活邮箱账号 * @param code 激活码 * @return 激活之后的指定页面 */ @RequestMapping(value = "active/email", method = RequestMethod.GET) public String handleActiveEmail(@RequestParam(value = "email") String email, @RequestParam(value = "code") String code, HttpServletResponse response) { try { UserDto userDto = developerService.findByEmail(email); Date now = new Date(); long interval = (now.getTime() - userDto.getUpdateTime().getTime()) / (1000 * 60); if (userDto == null) { //账号不存在 } else if (interval <= 1) { System.out.println(interval); //30分钟内激活 if (userDto.getEmailActivationCode().equals(code.trim()) && userDto.getEmailVerified() == false) { userDto.setEmailVerified(true); developerService.update(userDto); return "developer/register"; } else if (userDto.getEmailActivationCode().equals(code.trim()) && userDto.getEmailVerified() == true) { //已经激活过了,暂且返回该页面 return "developer/duplicate"; } else { //激活码不正确,验证失败,暂且返回该页面 return "developer/error"; } } else { //超过指定时间未激活,重新获取激活码 return "developer/reactive"; } } catch (CoreException e) { e.printStackTrace(); } return "developer/error"; }6 注册页面,填写相关信息并注册,表单的验证这里忽略!7 注册成功以后,,提交请求至第3步,会显示激活按钮,提示前往激活

293 评论(11)

carefreeyu

重新用邮箱注册,实在不行,你就打网站的服务电话

153 评论(12)

dreamydream

激活电子邮箱各大平台的注册账号激活方式不同,以淘宝注册账号为例,如何激活电子邮箱方法如下:1、点击:“使用邮箱验证”切换至邮箱注册的方式;2、填写电子邮箱,必须是未被注册使用的电子邮箱;3、绑定邮箱作为联系方式时,需要通过一个手机号来收取动态校验码,该手机号可以是任意手机号(包括已在淘宝注册过的手机号);4、输入手机收到的校验码,验证;5、校验成功后,淘宝将立即发送激活邮件到该电子邮箱;6、请前往电子邮箱收取激活邮件;7、阅读激活邮件内的提示信息,并完成激活。注意:不同平台的邮箱或者注册平台验证方法送时间不同,所以长时间没有收到激活邮箱,要耐心等待下。

189 评论(12)

相关问答