Subversion Repositories SmartDukaan

Rev

Rev 21734 | Rev 22744 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 21734 Rev 22398
Line 10... Line 10...
10
import org.springframework.context.annotation.Configuration;
10
import org.springframework.context.annotation.Configuration;
11
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
11
import org.springframework.context.support.PropertySourcesPlaceholderConfigurer;
12
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
12
import org.springframework.context.support.ReloadableResourceBundleMessageSource;
13
import org.springframework.core.io.ClassPathResource;
13
import org.springframework.core.io.ClassPathResource;
14
import org.springframework.core.io.Resource;
14
import org.springframework.core.io.Resource;
-
 
15
import org.springframework.mail.javamail.JavaMailSender;
-
 
16
import org.springframework.mail.javamail.JavaMailSenderImpl;
15
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
17
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
16
import org.springframework.web.servlet.view.InternalResourceViewResolver;
18
import org.springframework.web.servlet.view.InternalResourceViewResolver;
17
 
19
 
18
@Configuration
20
@Configuration
19
@ComponentScan("com.spice.profitmandi.*")
21
@ComponentScan("com.spice.profitmandi.*")
Line 83... Line 85...
83
		propertySourcesPlaceholderConfigurer.setLocation(resource);
85
		propertySourcesPlaceholderConfigurer.setLocation(resource);
84
 
86
 
85
		return propertySourcesPlaceholderConfigurer;
87
		return propertySourcesPlaceholderConfigurer;
86
	}
88
	}
87
	
89
	
-
 
90
	@Bean(name="mailSender")
-
 
91
    public JavaMailSender getGmailSender(){
-
 
92
        JavaMailSenderImpl mailSender = new JavaMailSenderImpl();
-
 
93
         
-
 
94
        //Using gmail
-
 
95
        mailSender.setHost("smtp.sendgrid.net");
-
 
96
        mailSender.setPort(587);
-
 
97
        mailSender.setUsername("apikey");
-
 
98
        mailSender.setPassword("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");
-
 
99
         
-
 
100
        Properties javaMailProperties = new Properties();
-
 
101
        javaMailProperties.put("mail.smtp.starttls.enable", "false");
-
 
102
        javaMailProperties.put("mail.smtp.auth", "false");
-
 
103
        javaMailProperties.put("mail.transport.protocol", "smtp");
-
 
104
        javaMailProperties.put("mail.debug", "true");//Prints out everything on screen
-
 
105
         
-
 
106
        mailSender.setJavaMailProperties(javaMailProperties);
-
 
107
        return mailSender;
-
 
108
    }
-
 
109
	
88
}
110
}
89
111