| Line 31... |
Line 31... |
| 31 |
|
31 |
|
| 32 |
@Autowired
|
32 |
@Autowired
|
| 33 |
JavaMailSender mailSender;
|
33 |
JavaMailSender mailSender;
|
| 34 |
|
34 |
|
| 35 |
@Override
|
35 |
@Override
|
| 36 |
public void sendPursaleRatioReportOnMail() throws MessagingException, UnsupportedEncodingException {
|
36 |
public void sendPurSaleRatioReportOnMail() throws MessagingException, UnsupportedEncodingException {
|
| 37 |
StringBuilder sb = new StringBuilder();
|
37 |
StringBuilder sb = new StringBuilder();
|
| 38 |
sb.append("<html><body><b>Stock List whose age is more then 10 days(Past 3 months Range)</b>" + "<br/><table style='border:1px solid black ;padding: 5px ;bgColor=green'>");
|
38 |
sb.append("<html><body><b>Stock List whose age is more then 10 days(Past 3 months Range)</b>" + "<br/><table style='border:1px solid black ;padding: 5px ;bgColor=green'>");
|
| 39 |
sb.append("<tbody>" +
|
39 |
sb.append("<tbody>" +
|
| 40 |
"<tr>" +
|
40 |
"<tr>" +
|
| 41 |
"<th style='border:1px solid black;padding: 5px'>No.</th>" +
|
41 |
"<th style='border:1px solid black;padding: 5px'>No.</th>" +
|
| Line 69... |
Line 69... |
| 69 |
String subject = "Age more than 10 days Stock Report";
|
69 |
String subject = "Age more than 10 days Stock Report";
|
| 70 |
String messageText = sb.toString();
|
70 |
String messageText = sb.toString();
|
| 71 |
MimeMessage message = mailSender.createMimeMessage();
|
71 |
MimeMessage message = mailSender.createMimeMessage();
|
| 72 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
72 |
MimeMessageHelper helper = new MimeMessageHelper(message, true);
|
| 73 |
String[] emailTo = {
|
73 |
String[] emailTo = {
|
| 74 |
// "sm@smartdukaan.com",
|
74 |
"sm@smartdukaan.com",
|
| 75 |
// "tarun.verma@smartdukaan.com",
|
75 |
"tarun.verma@smartdukaan.com",
|
| 76 |
// "mohit.gulati@smartdukaan.com",
|
76 |
"mohit.gulati@smartdukaan.com",
|
| 77 |
"tejus.lohani@smartdukaan.com",
|
77 |
"tejus.lohani@smartdukaan.com",
|
| 78 |
"tejuslohanibrb@gmail.com"
|
- |
|
| - |
|
78 |
|
| 79 |
};
|
79 |
};
|
| 80 |
helper.setSubject(subject);
|
80 |
helper.setSubject(subject);
|
| 81 |
helper.setText(messageText, true);
|
81 |
helper.setText(messageText, true);
|
| 82 |
helper.setTo(emailTo);
|
82 |
helper.setTo(emailTo);
|
| 83 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
|
83 |
InternetAddress senderAddress = new InternetAddress("noreply@smartdukaan.com", "Smartdukaan Alerts");
|