git-svn-id: https://svn.coded.pt/svn/SIPRP@1989 bb69d46d-e84e-40c8-a05a-06db0d633741

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Frederico Palma 11 years ago
parent 4fba54078c
commit b55f161a83

@ -15076,12 +15076,12 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean
//
// }
// private final String SMTP_HOST = "mail.evolute.pt";
private final String SMTP_HOST = "smtp.siprp.pt";
private final int SMTP_PORT = 587;
private final String mail_username = "servico@siprp.pt";
private final String mail_password = "GR33%df5";
private final String mail_bcc = "acidentes.auchan@siprp.pt";
private final String mail_bcc2 = "siprp.aat@evolute.pt";
private static final String SMTP_HOST = "smtp.siprp.pt";
private static final int SMTP_PORT = 587;
private static final String mail_username = "servico@siprp.pt";
private static final String mail_password = "GR33%df5";
private static final String mail_bcc = "acidentes.auchan@siprp.pt";
private static final String mail_bcc2 = "siprp.aat@evolute.pt";
// private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email)
// throws Exception
@ -15242,6 +15242,47 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean
}
}
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()
{
// AnaliseAcidente a = getSessionBean1().getCurrentAnalise();

Loading…
Cancel
Save