An open API service indexing awesome lists of open source software.

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

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



  1. Open the src/main/resources/application.properties file.

  2. 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



  3. For Gmail:


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.

Acknowledgements