Git Product home page Git Product logo

java-mail-api's Introduction

New User Email Notification

This is a Java application that sends an email notification to new registered user. This small project demonstrate how to use JavaMail to send an email and how to load email credentials form a .env file for added security.

Getting Started

Follow these instructions to set up and run the this project on your local machine.

Prerequisites

  • Java Development Kit (JDK) installed on your machine.
  • A text editor or an Integrated Development Environment (IDE) like Eclipse, IntelliJ IDEA, or NetBeans, But I like IntelliJ IDEA most.

Installation

  1. Open a Terminal and run the following commands.
mkdir javamail
cd javamail
git clone https://github.com/hemantDwivedi/java-mail-api.git

Or you can download and extract ZIP file.

  1. Create a .env file in the root directory of the project and add the following lines to it:
[email protected]
SENDER_PASSWORD=your_email_password

Replace [email protected] with your actual sender email and your_email_password with your actual sender email password.

Usage

  1. Open a terminal or command prompt and navigate to the root directory of the project.

  2. Compile the Java classes using the following command:

javac -cp lib/javax.mail.jar:lib/activation.jar src/main/java/com/email/Main.java
  1. Run the application using the following command:
java -cp .:lib/javax.mail.jar:lib/activation.jar src/main/java/com/email/Main
  1. The application will prompt you to enter a new user's name and email. It will then send an email to the provided email address, simulating an email notification for a newly created user.

Things to remember

  • Please keep the .env file secure and do not share it publicly or include it in version control systems.

  • This project is for demonstration purposes and lacks proper error handling and security features. In a production environment, use environment variables or other secure methods to manage sensitive configuration.

Acknowledgments

  • The JavaMail API and JavaBeans Activation Framework for enabling email functionality.

java-mail-api's People

Contributors

hemantdwivedi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.