package tr.bel.pendik.aquilamonitor.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.JavaMailSenderImpl;

import java.util.Properties;

@Configuration
public class MailConfig {

    @Bean
    public JavaMailSender mailSender() {
        JavaMailSenderImpl impl = new org.springframework.mail.javamail.JavaMailSenderImpl();

        Properties javaMailProperties = new Properties();
        javaMailProperties.setProperty("mail.smtp.auth", "true");
        javaMailProperties.setProperty("mail.smtp.starttls.enable", "true");
        javaMailProperties.setProperty("mail.smtp.ssl.trust",
                "CASHUB.pendik.bel.tr");
        impl.setJavaMailProperties(javaMailProperties);

        impl.setHost("CASHUB.pendik.bel.tr");
        // impl.setPort(587);
        impl.setUsername("digikent@pendik.bel.tr");
        impl.setPassword("Pendik1");

        return impl;
    }

    @Bean
    public SimpleMailMessage templateMailMessage() {
        SimpleMailMessage msg = new SimpleMailMessage();
        msg.setFrom("digikent@pendik.bel.tr");
        msg.setTo("moyavuz@pendik.bel.tr");
        msg.setSubject("Hata - >");
        msg.setText("<![CDATA[\nDear %s,\n	Mail Content : %s\n	]]>");
        return msg;
    }

}

@@ -818,38 +818,36 @@
         %22CASHUB.
-pendik
+xxxx
 .bel.tr%22);%0A     
@@ -927,22 +927,22 @@
 %22CASHUB.
-pendik
+xxxxxx
 .bel.tr%22
@@ -1000,31 +1000,27 @@
 ername(%22
-digikent@pendik
+xxxx@xxxxxx
 .bel.tr%22
@@ -1052,15 +1052,13 @@
 rd(%22
-Pendik1
+xxxxx
 %22);%0A
@@ -1231,16 +1231,14 @@
 om(%22
-digikent
+xxxxxx
 @pen
@@ -1274,15 +1274,13 @@
 To(%22
-moyavuz
+xxxxx
 @pen

Update MailConfig.java