envio de mails -> nome de utilizador estava errado.

git-svn-id: https://svn.coded.pt/svn/SIPRP@1134 bb69d46d-e84e-40c8-a05a-06db0d633741
0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Diogo Neves 16 years ago
parent 8a0389c84f
commit 542f14874c

@ -14058,6 +14058,8 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
texto_email += "<p>Recebeu um novo processo de an&aacute;lise de acidente de trabalho para tratar.</p>";
texto_email += "<p>Por favor, aceda a www.siprp.pt, separador colaboradores em 'Acesso &agrave; Gest&atilde;o de An&aacute;lises de Acidentes de Trabalho' e prossiga com a gest&atilde;o do processo " + a.getAnalise_nr() + ".</p>";
System.out.println( "Sending mail to next user." );
String responsavel_loja = "n";
switch (estado.intValue())
{
@ -14253,13 +14255,14 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
//// }
//
// }
private final String mail_username = "acidentes.auchan@siprp.pt";
private final String mail_password = "47Ju6Vb";
public class SMTPAuthenticator extends Authenticator {
public PasswordAuthentication getPasswordAuthentication() {
String username = "acidentes.auchan";
String password = "47Ju6Vb";
return new PasswordAuthentication(username, password);
}
public PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication( mail_username, mail_password );
}
}
private void sendEmail(String emailTo, String emailFrom, String assunto, String texto_email) throws Exception
{
@ -14268,8 +14271,8 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
props.put("mail.smtp.host", "mail2.evolute.pt");
props.put("mail.from", emailFrom);
props.put("mail.smtp.auth", "true");
props.put("mail.smtp.user", "acidentes.auchan");
props.put("mail.smtp.password", "47Ju6Vb");
props.put("mail.smtp.user", mail_username );
props.put("mail.smtp.password", mail_password );
// Session session1 = Session.getInstance(props);
Authenticator auth = new SMTPAuthenticator();
Session session = Session.getDefaultInstance(props, auth);
@ -14289,9 +14292,9 @@ public class AnaliseAcidenteTrabalho extends AbstractPageBean {
html+="<body></html>";
msgBodyPart.setContent(html, "text/html");
multipart.addBodyPart(msgBodyPart);
msg.setContent(multipart);
msg.setContent(multipart);
Transport.send(msg);
System.out.println("Email Enviado !!!! ");
System.out.println("Email Enviado !!!! - " + emailTo );
}

Loading…
Cancel
Save