상세 컨텐츠

본문 제목

[ 웹개발 기타 ] FAKE SMTP

실무/[ 기타 ]

by glenn93 2024. 3. 15. 15:32

본문

728x90
반응형
Fake SMTP 라이브러리 사용 이유

메일 서버가 운영에만 존재하여 로컬/개발 서버에서 메일 통신 여부를 확인 할 때 사용

 

 

 

1. 라이브러리 다운로드

fakeSMTP-2.0.jar 파일을 참고 사이트 2번에서 다운.(파일첨부)

 

참고 사이트

  1. https://kimvampa.tistory.com/92
  2. https://nilhcem.com/FakeSMTP/
 

FakeSMTP – FakeSMTP - Dummy SMTP server for developers

Overview FakeSMTP is a Free Fake SMTP Server with GUI for testing emails in applications easily. It is written in Java. Configure your application to use "localhost" as your SMTP server, and all emails will be intercepted and displayed in this software. Fa

nilhcem.com

[첨부파일]

fakeSMTP-2.0.jar
1.76MB

 

 

 

 

2. fakeSMTP  GUI 실행 후 사용
  1. 커멘드 창 실행 후 fakeSMTP-2.0.jar 파일의 위치로 이동
  2. 파일 실행 :  java -jar fakeSMTP-2.0.jar 명령어로 GUI 실행
  3. 포트번호 설정 후 서버 열기(2525)

  4. 스프링 (root-context.xml 또는 context-scheduler.xml) 파일에 코드 추가
<bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl">
	<property name="host" value="localhost" />
	<property name="port" value="2525" />
</bean>

 

    5. GUI & 스프링의 포트가 연동된 후 메일 로직 실행 시 FAKE SMTP서버로 fake mail이 발송됨. 따라서 로컬, 개발서버에서 메일 발송 여부파악 가능

728x90
반응형

관련글 더보기