|
|
|
|
@ -14109,7 +14109,8 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
System.out.println("USER MAIL NEXT FASE : " + u.getLogin() + " ; " + u.getEmail());
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
//sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
sendEmailWithPdf(a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex1)
|
|
|
|
|
{
|
|
|
|
|
@ -14147,7 +14148,8 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
texto_email += "<p style='text-align: justify; font-family: arial, sans-serif'>Cumprimentos.</p>";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
sendEmailWithPdf(a, ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email );
|
|
|
|
|
//sendEmail(ac.getEmail_superior_hierarquico(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
@ -14175,7 +14177,8 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
texto_email += "<p style='text-align: justify; font-family: arial, sans-serif'>SIPRP </p>";
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
//sendEmail(u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
sendEmailWithPdf(a, u.getEmail(), Global.ENDERECO_ENVIO, assunto, texto_email);
|
|
|
|
|
}
|
|
|
|
|
catch(Exception ex)
|
|
|
|
|
{
|
|
|
|
|
@ -14378,7 +14381,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
msg.setRecipients( Message.RecipientType.BCC, addressBCC );
|
|
|
|
|
|
|
|
|
|
((MimeMessage)msg).setSubject(assunto, "UTF-8");
|
|
|
|
|
msg.setSentDate(new Date());
|
|
|
|
|
msg.setSentDate(new Date());
|
|
|
|
|
Multipart multipart = new MimeMultipart();
|
|
|
|
|
BodyPart msgBodyPart = new MimeBodyPart();
|
|
|
|
|
String html;
|
|
|
|
|
@ -14388,7 +14391,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
html+="<body></html>";
|
|
|
|
|
msgBodyPart.setContent(html, "text/html");
|
|
|
|
|
multipart.addBodyPart(msgBodyPart);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MimeBodyPart pdfPart = new MimeBodyPart();
|
|
|
|
|
//pdfPart.setContent(ds,"application/pdf");
|
|
|
|
|
pdfPart.setDataHandler(new DataHandler(ds));
|
|
|
|
|
@ -14396,8 +14399,11 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
|
|
|
|
|
pdfPart.setHeader("Content-Disposition","attachment");
|
|
|
|
|
String pdfname = "Analise" + a.getAnalise_nr();
|
|
|
|
|
pdfPart.setFileName(pdfname);
|
|
|
|
|
multipart.addBodyPart(pdfPart,1);
|
|
|
|
|
msg.setContent(multipart);
|
|
|
|
|
multipart.addBodyPart(pdfPart,1);
|
|
|
|
|
|
|
|
|
|
msg.setContent(multipart);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Transport.send(msg);
|
|
|
|
|
Transport t;
|
|
|
|
|
t = session.getTransport( "smtp" );
|
|
|
|
|
|