Categories: Miscellaneous

Free Birthday and Anniversary Mail Sender Software

How about setting up an automated mail sender application which sends the birthday and anniversary mails to the employees in your organization ? It will be awesome right!!!! Let’s find out how to make it happen.

The GitHub Link :

I have written an application in my free time to send birthday and anniversary mails to our colleagues. You can use it too as I have made it completely open source licensed under Apache-v2.0. Here is the complete link of the source code from GitHub.

The Hello-World Application

Requirements :

  • CentOS Linux Recommended for hosting the application
  • MariaDB to store the configurations and email contents
  • JDK 1.8
  • JavaMail (Or you can configure your own SMTP server)

Features :

  • All the configurations are in Database. Any configuration change is picked up quickly by the application.
  • Configurable email templates
  • Free-marker support.
  • Add multiple probable mail content and the application will select one of them randomly.

Installation Instructions :

  • Download the source from the above link
  • Build the application by running the command –
$ mvn clean package
  • Run in background –
$ nohup java -jar /home/centos/hello-world-0.0.1-SNAPSHOT.jar > /var/log/hello-world/hello-world.log &
  • Checking detailed log –
$ tail -f /var/log/hello-world/hello-world.log

Application Properties :

As this is a Spring Boot Application, below is the application properties that you will need to configure the Data Source, Logging and the SMTP Mail Server. Note that, if you don’t have a SMTP mail server, this application can also run on JavaMail dependency.

logging.level.org.springframework=INFO
logging.level.se.seamless.sfo=DEBUG
logging.file=/var/log/hello-world/hello-world.log
logging.pattern.file= %d{yyyy-MM-dd HH:mm:ss} [%thread] %-5level %logger{36} - %msg%


# Spring DataSource properties
spring.datasource.url=jdbc:mysql://0.0.0.0:3306/HELLO_WORLD?createDatabaseIfNotExist=true
spring.datasource.username=root
spring.datasource.password=root
spring.datasource.driver-class-name=org.mariadb.jdbc.Driver

spring.jpa.properties.hibernate.dialect = org.hibernate.dialect.MySQL5Dialect
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
spring.jpa.hibernate.ddl-auto=update
spring.jpa.properties.hibernate.enable_lazy_load_no_trans=true


############# MAIL CONFIGURATION ##############
#spring.mail.host=smtp.gmail.com
#spring.mail.port=587
#spring.mail.username=hr.india@2darray.com
#spring.mail.password=###########
#spring.mail.properties.mail.smtp.auth=true
#spring.mail.properties.mail.smtp.starttls.enable=true

Running the Birthday and Anniversary Mail Sender :

Once you complete setup the configuration, it is recommended to start your application in background in a server. To run the application you need to fire the below command from your terminal.

java -jar hello-world.jar --spring.config.location=<link to your customized properties file>

More details about the application and all the configuration for setting up is provided in the README file of the GitHub Repository.

I hope this application will bring some smiles to your colleagues when they will receive those greetings on their Birthdays and Work Anniversaries.

Check out my other articles on Miscellaneous category.

Parijat Mukherjee

Hi There !!! I am a Software Engineer and I am always in a process of learning something new. I love the works that are outside my comfort zone. Rather than focusing on a particular programming language, I try to focus on the design patterns and technologies because I believe, if someone understands the "What" and the "Why" part of a problem and the technology or tool, then the "How" part can be easily done by any of the programming language available in the market.

Recent Posts

Spring Security Architecture – Authentication

The Spring Security project is perhaps the biggest and one of the best projects so far by Spring. When I…

2 weeks ago

Make Use of SOLID Coding Principles

We all know what are the pros and cons of Object Oriented Programming, but what about writing better codes? What…

2 weeks ago

How to Dockerize Spring Boot Applications

Article to demonstrate how to dockerize a spring boot application with all the required maven dependency plugins and Dockerfile.

2 months ago

Create a Spring Boot 2 Application & Register it in Eureka

Spring boot tutorial and a eureka client example including eureka client properties to guide the microservice beginners.

3 months ago

Create Eureka Server Using Spring Cloud

Quick beginners guide to Eureka Server using Spring Cloud with all the necessary eureka server dependency maven dependencies and eureka…

3 months ago

How to create MariaDB Galera Cluster in CentOS 6.x

Galera cluster tutorial and overview for the beginners followed by galera cluster setup centos 6 and galera cluster configuration.

2 years ago