https://github.com/ayushkhodankar/emailsenderapplication
Spring Boot-based Email Sender Application that allows users to send emails through a simple and user-friendly interface
https://github.com/ayushkhodankar/emailsenderapplication
emailsender jakarta-mail springboot
Last synced: 3 months ago
JSON representation
Spring Boot-based Email Sender Application that allows users to send emails through a simple and user-friendly interface
- Host: GitHub
- URL: https://github.com/ayushkhodankar/emailsenderapplication
- Owner: Ayushkhodankar
- Created: 2025-01-06T15:00:49.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2025-01-06T15:23:27.000Z (5 months ago)
- Last Synced: 2025-03-06T20:17:08.637Z (3 months ago)
- Topics: emailsender, jakarta-mail, springboot
- Language: Java
- Homepage:
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Email Sender Application
This is a Spring Boot-based Email Sender Application that allows users to send emails through a simple and user-friendly interface.
The backend is built with Spring Boot, and the frontend is developed using HTML, CSS, and JavaScript. This project supports Java 17 and integrates
with SMTP for sending emails.Features
- Send emails to any recipient.
- Simple frontend with a lightweight design.
- Secure SMTP authentication.
- Configurable SMTP settings via
application.properties
. - Built for Java 17.
Project Structure
EmailSender/
├── src/
│ ├── main/
│ │ ├── java/com/emailsender/
│ │ │ ├── EmailSenderApplication.java # Main application file
│ │ │ ├── controller/EmailController.java # REST API controller
│ │ │ ├── service/EmailService.java # Email sending logic
│ │ ├── resources/
│ │ │ ├── application.properties # Email configuration
│ │ ├── webapp/
│ │ │ ├── index.html # Frontend HTML
│ │ │ ├── styles.css # Frontend CSS
├── pom.xml # Maven dependencies
Prerequisites
Software Requirements:
- Java 17 or later installed.
- Maven installed.
- An email account for SMTP (e.g., Gmail, Outlook).
Setup Instructions
Clone the Repository
git clone https://github.com/your-username/email-sender.git
cd email-sender
Configure the SMTP Server
- Open the
src/main/resources/application.properties
file. - Update the following properties with your email and password:
spring.mail.host=smtp.gmail.com
spring.mail.port=587
[email protected]
spring.mail.password=your-app-password
spring.mail.properties.mail.smtp.auth=true
spring.mail.properties.mail.smtp.starttls.enable=true
-
For Gmail:
- If you use 2FA, create an App Password.
- If not, enable "Less Secure Apps" in your Google Account settings.
Build and Run the Application
mvn clean install
mvn spring-boot:run
Access the Frontend
Open your browser and go to:
http://localhost:8080
Fill in the form with the recipient email, subject, and message, then click Send Email.
API Endpoints
Send Email
POST /api/email/send
Request Parameters:
Parameter
Type
Description
to
String
Recipient email address
subject
String
Email subject
body
String
Email message body
Example Request:
curl -X POST "http://localhost:8080/api/email/send" \
-d "[email protected]&subject=Hello&body=Test message"
Example Response:
Success:
"Email sent successfully to [email protected]"
Error:
"Error sending email: Authentication failed"
License
This project is licensed under the MIT License. See the LICENSE
file for details.