|
|
|
@ -15076,12 +15076,12 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// private final String SMTP_HOST = "mail.evolute.pt";
|
|
|
|
// private final String SMTP_HOST = "mail.evolute.pt";
|
|
|
|
private final String SMTP_HOST = "smtp.siprp.pt";
|
|
|
|
private static final String SMTP_HOST = "smtp.siprp.pt";
|
|
|
|
private final int SMTP_PORT = 587;
|
|
|
|
private static final int SMTP_PORT = 587;
|
|
|
|
private final String mail_username = "servico@siprp.pt";
|
|
|
|
private static final String mail_username = "servico@siprp.pt";
|
|
|
|
private final String mail_password = "GR33%df5";
|
|
|
|
private static final String mail_password = "GR33%df5";
|
|
|
|
private final String mail_bcc = "acidentes.auchan@siprp.pt";
|
|
|
|
private static final String mail_bcc = "acidentes.auchan@siprp.pt";
|
|
|
|
private final String mail_bcc2 = "siprp.aat@evolute.pt";
|
|
|
|
private static final String mail_bcc2 = "siprp.aat@evolute.pt";
|
|
|
|
|
|
|
|
|
|
|
|
// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email)
|
|
|
|
// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email)
|
|
|
|
// throws Exception
|
|
|
|
// throws Exception
|
|
|
|
@ -15233,7 +15233,7 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean
|
|
|
|
|
|
|
|
|
|
|
|
Transport t;
|
|
|
|
Transport t;
|
|
|
|
t = session.getTransport( "smtp" );
|
|
|
|
t = session.getTransport( "smtp" );
|
|
|
|
|
|
|
|
|
|
|
|
t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password );
|
|
|
|
t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password );
|
|
|
|
t.sendMessage( msg, msg.getAllRecipients() );
|
|
|
|
t.sendMessage( msg, msg.getAllRecipients() );
|
|
|
|
|
|
|
|
|
|
|
|
@ -15241,6 +15241,47 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean
|
|
|
|
System.out.println( "Email Pdf Enviado !!!! " + emailTo );
|
|
|
|
System.out.println( "Email Pdf Enviado !!!! " + emailTo );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public static void main( String args[] )
|
|
|
|
|
|
|
|
throws Exception
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Properties props = new Properties();
|
|
|
|
|
|
|
|
props.put( "mail.smtp.host", SMTP_HOST );
|
|
|
|
|
|
|
|
props.put( "mail.from", "servico@siprp.pt" );
|
|
|
|
|
|
|
|
props.put( "mail.smtp.auth", "true" );
|
|
|
|
|
|
|
|
props.put( "mail.smtp.user", mail_username );
|
|
|
|
|
|
|
|
props.put( "mail.smtp.password", mail_password );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Session session = Session.getDefaultInstance( props );
|
|
|
|
|
|
|
|
Message msg = new MimeMessage( session );
|
|
|
|
|
|
|
|
msg.setFrom( new InternetAddress( "servicos@siprp.pt" ) );
|
|
|
|
|
|
|
|
InternetAddress[] address = { new InternetAddress( "fpalma@evolute.pt" ) };
|
|
|
|
|
|
|
|
msg.setRecipients( Message.RecipientType.TO, address );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
( ( MimeMessage ) msg ).setSubject( "teste", "UTF-8" );
|
|
|
|
|
|
|
|
msg.setSentDate( new Date() );
|
|
|
|
|
|
|
|
Multipart multipart = new MimeMultipart();
|
|
|
|
|
|
|
|
BodyPart msgBodyPart = new MimeBodyPart();
|
|
|
|
|
|
|
|
String html;
|
|
|
|
|
|
|
|
html = "<html><head> <meta content='text/html;charset=ISO-8859-1' http-equiv='Content-Type'></head>";
|
|
|
|
|
|
|
|
html += "<body bgcolor='#ffffff' text='#000000'>";
|
|
|
|
|
|
|
|
html += "<div>teste</div>";
|
|
|
|
|
|
|
|
html += "<body></html>";
|
|
|
|
|
|
|
|
msgBodyPart.setContent( html, "text/html" );
|
|
|
|
|
|
|
|
multipart.addBodyPart( msgBodyPart );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
msg.setContent( multipart );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Transport t;
|
|
|
|
|
|
|
|
t = session.getTransport( "smtp" );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t.connect( SMTP_HOST, SMTP_PORT, mail_username, mail_password );
|
|
|
|
|
|
|
|
t.sendMessage( msg, msg.getAllRecipients() );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
t.close();
|
|
|
|
|
|
|
|
System.out.println( "Email Pdf Enviado !!!! " );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public String butImprimir_action()
|
|
|
|
public String butImprimir_action()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|