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

0'XOR(if(now()=sysdate(),sleep(15),0))XOR'Z
Tiago Simão 16 years ago
parent 7bc15ba2de
commit 2684eab3e2

@ -55,6 +55,7 @@ import siprp.higiene.gestao.equipamentos.AdicionarEquipamentosPanel;
import siprp.higiene.relatorio.print.RelatorioPDFCreator;
import siprp.logic.HigieneSegurancaLogic;
import siprp.medicina.processo.mail.MailDialog;
import siprp.medicina.processo.mail.MailSender;
import siprp.planoactuacao.print.PlanoActuacaoPDFCreator;
import com.evolute.utils.ui.calendar.JCalendarPanel;
@ -374,6 +375,10 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
relatorio.save();
setRelatorio( relatorio, false );
}
else
{
JOptionPane.showMessageDialog( this, "Erro ao enviar o email, o plano n"+atilde+"o ser"+aacute+" submetido." );
}
}
}
catch( Exception e )
@ -537,7 +542,7 @@ public class PanelRelatorio extends JPanel implements CaretListener, ChangeListe
"<br>" +
"<br>" +
"Esta " + eacute + " uma mensagem gerada automaticamente pelo nosso sistema, por favor n" + atilde + "o responda.</font></p></html>";
MailDialog md = new MailDialog( getFrame(), to, bcc, subject, body, getRelatoriosTemp(relatorio) );
MailDialog md = new MailDialog( getFrame(), to, bcc, subject, body, getRelatoriosTemp(relatorio), MailSender.from );
result = md.wasSent();
}
return result;

@ -110,10 +110,13 @@ public class MailDialog extends CustomJDialog
// System.exit( 0 );
// }
public MailDialog( JFrame owner, String to, String bcc, String subject, String message, Vector<File> files)
private final String[] additionalBCCs;
public MailDialog( JFrame owner, String to, String bcc, String subject, String message, Vector<File> files, String ... additionalBCCs)
throws Exception
{
super( owner, true );
this.additionalBCCs = additionalBCCs;
this.owner = owner;
commonStartup();
setTo( to );
@ -532,6 +535,15 @@ public class MailDialog extends CustomJDialog
// close();
String to = toText.getText();
String bcc = bccText.getText();
if( additionalBCCs != null )
{
String bccconcat = "";
for( String b : additionalBCCs )
{
bccconcat += b + ", ";
}
bcc = bccconcat + bcc;
}
String subject = subjectText.getText();
String body = bodyPane.getText();
String attachmentList[] = new String[ attachmentsTable.getRowCount() ];

@ -22,7 +22,7 @@ import javax.mail.internet.MimeMultipart;
public class MailSender
{
protected String from = "departamentotecnico@siprp.pt";
public static final String from = "departamentotecnico@siprp.pt";
protected String mailServer = "mail2.evolute.pt";
protected String userName = "auto@siprp.pt";
protected String password = "sdfoyias78e";

Loading…
Cancel
Save