| Line 13... |
Line 13... |
| 13 |
import org.springframework.context.annotation.Configuration;
|
13 |
import org.springframework.context.annotation.Configuration;
|
| 14 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
14 |
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
|
| 15 |
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
15 |
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
|
| 16 |
import org.springframework.core.io.ClassPathResource;
|
16 |
import org.springframework.core.io.ClassPathResource;
|
| 17 |
import org.springframework.core.io.Resource;
|
17 |
import org.springframework.core.io.Resource;
|
| - |
|
18 |
import org.springframework.mail.javamail.JavaMailSender;
|
| - |
|
19 |
import org.springframework.mail.javamail.JavaMailSenderImpl;
|
| 18 |
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
20 |
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
|
| 19 |
import org.springframework.web.servlet.ViewResolver;
|
21 |
import org.springframework.web.servlet.ViewResolver;
|
| 20 |
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
|
22 |
import org.springframework.web.servlet.view.velocity.VelocityConfigurer;
|
| 21 |
import org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver;
|
23 |
import org.springframework.web.servlet.view.velocity.VelocityLayoutViewResolver;
|
| 22 |
|
24 |
|
| Line 102... |
Line 104... |
| 102 |
|
104 |
|
| 103 |
propertySourcesPlaceholderConfigurer.setLocation(resource);
|
105 |
propertySourcesPlaceholderConfigurer.setLocation(resource);
|
| 104 |
|
106 |
|
| 105 |
return propertySourcesPlaceholderConfigurer;
|
107 |
return propertySourcesPlaceholderConfigurer;
|
| 106 |
}
|
108 |
}
|
| - |
|
109 |
|
| - |
|
110 |
@Bean(name="mailSender")
|
| - |
|
111 |
public JavaMailSender getGmailSender(){
|
| - |
|
112 |
JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
|
| - |
|
113 |
|
| - |
|
114 |
//Using gmail
|
| - |
|
115 |
mailSender.setHost("smtp.sendgrid.net");
|
| - |
|
116 |
mailSender.setPort(587);
|
| - |
|
117 |
mailSender.setUsername("shop2020");
|
| - |
|
118 |
mailSender.setPassword("U2/=fP,t");
|
| - |
|
119 |
|
| - |
|
120 |
Properties javaMailProperties = new Properties();
|
| - |
|
121 |
javaMailProperties.put("mail.smtp.starttls.enable", "false");
|
| - |
|
122 |
javaMailProperties.put("mail.smtp.auth", "true");
|
| - |
|
123 |
javaMailProperties.put("mail.transport.protocol", "smtp");
|
| - |
|
124 |
javaMailProperties.put("mail.debug", "true");//Prints out everything on screen
|
| - |
|
125 |
|
| - |
|
126 |
mailSender.setJavaMailProperties(javaMailProperties);
|
| - |
|
127 |
return mailSender;
|
| - |
|
128 |
}
|
| - |
|
129 |
|
| - |
|
130 |
|
| 107 |
|
131 |
|
| 108 |
}
|
132 |
}
|
| 109 |
|
133 |
|