티스토리 뷰
Spring을 이용해서 회원가입시 가입이 됬다는
메일은 보내기 간단하다
Gmail의 SMTP를 사용하면 쉽다
먼저 필요한 jar파일들을 알아보면
activation.jar
commons-collection.jar
commons-lang.jar
commons-logging.jar
standard.jar
spring.jar
6개가 필요한데 인터넷에서 쉽게 찾을수 있다.
먼저 applicationContext.xml 에 아래 내용을 추가한다
아래는 컨트롤러딴 부분이다. 이러고 회원가입시 아래 컨트롤러를 호출해주면 간다true true true javax.net.ssl.SSLSocketFactory false 465 465
@Autowired private MailSender mailSender; @RequestMapping("/myPassChange") public ModelAndView myPassChange(HttpServletResponse response, httpServletRequest request, ModelAndView mav) throws Exception { String id=(String) WebUtils.getSessionAttribute(request, "id"); String password=request.getParameter("newPass1"); System.out.println(password); HashMapparam=new HashMap (); param.put("id", id); param.put("password",ByteUtils.toHexString(StringCipher.encrypt(password))); sendEmail("imjehoon@naver.com","imjehoon"); service.updatePass(param); mav.setViewName("redirect:/jhMemberMain.do"); return mav; } public void sendEmail(String email, String userId) { SimpleMailMessage message=new SimpleMailMessage(); message.setSubject("제목"); message.setText("내용"); message.setTo(email); try{ mailSender.send(message); }catch(MailException e){ e.printStackTrace(); } }
'Java > Spring' 카테고리의 다른 글
Spring 한글 깨짐 설정 (0) | 2015.07.28 |
---|---|
Spring WebSocket sockJS 채팅 예제 (0) | 2015.07.23 |
Spring locale 나라 별 코드 (0) | 2014.04.14 |
Cookie 생성/ 설정/ 삭제 (0) | 2012.08.19 |
Spring STS MAVEN MVC 개발 환경 / JAR 용도 설명 (0) | 2012.08.16 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- 알고리즘
- 삽입정렬
- 전화번호
- binarysearch
- 스프링
- selectionSort
- websocket
- 태그를 입력해 주세요.
- Java
- 버블정렬
- 이진탐색
- Mergesort
- SQL
- sockjs
- Spring메일
- Algorithm
- jquery
- 페이징
- iBATIS
- BubbleSort
- InsertionSort
- dbconnection
- 선택정렬
- mysql
- Quicksort
- 퀵정렬
- Cookie
- 팩토리얼
- spring
- 합병정렬
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
글 보관함