Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/feltex/servicoemailsimples
Projeto básico de como utilizar Spring Boot enviando email via GMail
https://github.com/feltex/servicoemailsimples
gmail gmail-api java spring-boot springboot
Last synced: 19 days ago
JSON representation
Projeto básico de como utilizar Spring Boot enviando email via GMail
- Host: GitHub
- URL: https://github.com/feltex/servicoemailsimples
- Owner: feltex
- Created: 2022-01-11T22:38:21.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2022-01-27T20:33:07.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T19:07:45.490Z (2 months ago)
- Topics: gmail, gmail-api, java, spring-boot, springboot
- Language: Java
- Homepage:
- Size: 93.8 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Projeto de Envio de Email
Projeto simples com Java e Spring Boot para enviar email utilizando contas do Gmail.
Vídeo: https://youtu.be/so3nq5NapHA
## Pré Requisitos
- Maven 3.6
- Java 11
- Conta de email no [Gmail](https://mail.google.com)
- Código no GitHub [Feltex](https://github.com/feltex/ServicoEmailSimples)## Criando o jar
mvn clean package
## Executando o projeto
- Utilizando o arquivo jar
```
export [email protected]
export SPRING_EMAIL_PASSWORD=********************java -jar target/ServicoEmail.jar
```- Utilizando o maven
```
export [email protected]
export SPRING_EMAIL_PASSWORD=********************
mvn spring-boot:run
```## Possíveis erros
1. Erro de acesso `535-5.7.8 Username and Password not accepted.`
```
# Caused by: org.springframework.mail.MailAuthenticationException: Authentication failed; nested exception is javax.mail.AuthenticationFailedException: 535-5.7.8 Username and Password not accepted. Learn more at
# 535 5.7.8 https://support.google.com/mail/?p=BadCredentials m35sm5842510wms.1 - gsmtp
```1. Confirme se usuário e senha estão corretos.
2. Desabilite a verificação em 2 [etapas](https://support.google.com/accounts/answer/1064203?hl=pt-BR&co=GENIE.Platform%3DDesktop)
3. Para enviar email em sua aplicação você precisa habilitar uma configuração de segurança no Gmail
1. Habilitando aplicações menos Seguras no GMail[detalhes](https://support.google.com/accounts/answer/6010255?hl=pt).