Giter Club home page Giter Club logo

spring-boot-email's Introduction

spring-boot-email

Spring Boot – Sending Email via SMTP

Spring Boot provides the ability to send emails via SMTP using the JavaMail Library. Here we will be illustrating step-by-step guidelines to develop Restful web services that can be used to send emails with or without attachments. In order to begin with the steps, let us first create a Spring Boot project using Spring Initializer.

What you'll learn Setting up Spring Boot project. Configuring SMTP server. Sending Plain Email only message. Email with message and attachments. Email with message, inline images and attachments. How to develop Body of email. Send email from Spring Boot Application to Outlook How Spring Boot Mail API works. Understand the Java mail API fundamentals Use HTML, CSS to create, design email

Implementation Step 1: Create a Spring Boot Web Application using Spring Initializer

Step 2: Adding the spring-boot-starter-mail dependency in pom.xml.

    <dependency>
        <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-mail</artifactId>
    </dependency>

Step 3: Configure SMTP server detail in Application.properties.

    ########## SMTP configuration to send out emails ##########
    ####### Make sure to use the correct SMTP configurations #######
    spring.mail.host=mail.madarasa.com.in
    spring.mail.port=465
    [email protected]
    spring.mail.password=yourmailpassword
    
    # Other properties
    spring.mail.properties.mail.smtp.auth=true
    spring.mail.properties.mail.smtp.connectiontimeout=5000
    spring.mail.properties.mail.smtp.timeout=5000
    spring.mail.properties.mail.smtp.writetimeout=5000
    
    # TLS , port 587
    spring.mail.properties.mail.smtp.starttls.enable=true
    
    # SSL, post 465
    spring.mail.properties.mail.smtp.socketFactory.port = 465
    spring.mail.properties.mail.smtp.socketFactory.class = javax.net.ssl.SSLSocketFactory

For Demo use the below link

https://madarasa.com.in/spring-boot/spring-boot-email

spring-boot-email's People

Contributors

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