Class MailConfig

java.lang.Object
edu.ntnu.idatt2106_2023_06.backend.config.MailConfig

@Configuration public class MailConfig extends Object
This class provides a configuration for the JavaMailSender, which is used to send email. It sets up the host, port, username, and password for the email server to be used. Additionally, it configures the properties for the email sender, such as whether to use starttls and the host and port to use for the SMTP server. The configuration is retrieved from the application.properties file using Spring's Value annotation.
Author:
Trym Hamer Gudvangen
  • Constructor Details

    • MailConfig

      public MailConfig()
  • Method Details

    • javaMailSender

      @Bean public org.springframework.mail.javamail.JavaMailSender javaMailSender()
      This method creates a new JavaMailSender bean with the configured properties.
      Returns:
      The newly created JavaMailSender