728x90
반응형
1. 에러 로그 및 문제점
Mail server connection failed.
Failed messages: org.eclipse.angus.mail.util.MailConnectException
: Couldn't connect to host, port: stmp.gmail.com, 587; timeout -1;
nested exception is:
java.net.UnknownHostException: stmp.gmail.com
구글 이메일 전송 기능 설정 후, swagger를 이용하여 실행해보았을 때 위와 같은 에러 로그가 떴다.
# google mail
spring.mail.host=stmp.gmail.com
spring.mail.port=587
spring.mail.username=ENC(암호화된 구글 아이디)
spring.mail.password=ENC(암호화된 구글 앱 비밀번호)
spring.mail.properties.mail.stmp.auth=true
spring.mail.properties.mail.stmp.timeout=5000
spring.mail.properties.mail.stmp.starttls.enable=true
application.properties에 위와 같이 설정을 하였다.
허무하게도 smtp라고 적어야 할 것을 전부 stmp로 오타를 낸 게 문제였다ㅋ 진짜 정신 없다
나 같은 경우는 stmp라고 오타를 내서 그런 거지만
오타를 내지 않았다면 properties 설정을 잘못했을 수 있다
2. 해결방법
# google mail
spring.mail.host=smtp.gmail.com
spring.mail.port=587
spring.mail.username=ENC(암호화된 구글 아이디)
spring.mail.password=ENC(암호화된 구글 앱 비밀번호)
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.timeout=5000
spring.mail.properties.mail.smtp.starttls.enable=true
stmp -> smtp 오타를 수정했다.
3. 결과

Swagger를 확인해보았을 때 200 Code가 떴고, 메일함에도 메일이 잘 와 있는 걸 확인할 수 있었다.
728x90
반응형
'Trouble Shooting' 카테고리의 다른 글
| [공공데이터포털] 공공 API 사용 시 500 Error "message": "Method Not Allowed" 해결 (0) | 2024.11.25 |
|---|---|
| [React] 인증번호 일치 확인 구현 중 일치하는 값을 넣어도 일치하지 않는다고 뜰 때 (0) | 2024.11.24 |
| [SpringBoot] org.springframework.beans.factory.UnsatisfiedDependencyException 해결 (Base64 인코딩 관련) (1) | 2024.11.20 |
| [SpringBoot] @Value 사용 시 Cannot find method 'value' 해결 (0) | 2024.11.18 |
| [React] 중첩 라우팅 시 정상적으로 렌더링되지 않아 빈 화면이 뜰 때 (+Outlet) (0) | 2024.11.15 |