Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Mail versenden bei Exception bei Versand #215

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 26 additions & 19 deletions src/de/jost_net/JVerein/gui/control/MailControl.java
Original file line number Diff line number Diff line change
Expand Up @@ -463,33 +463,40 @@ public void run(ProgressMonitor monitor)
int sentCount = 0;
for (final MailEmpfaenger empf : getMail().getEmpfaenger())
{
EvalMail em = new EvalMail(empf);
if (erneutSenden || empf.getVersand() == null)
try
{
sender.sendMail(empf.getMailAdresse(), em.evalBetreff(betr),
em.evalText(txt), getMail().getAnhang());
sentCount++;
monitor.log(empf.getMailAdresse() + " - versendet");
// Nachricht wurde erfolgreich versendet; speicher Versand-Datum
// persistent.
empf.setVersand(new Timestamp(new Date().getTime()));
// Fix null value in colum mail for mailempfaenger
empf.setMail(getMail());
empf.store();
// aktualisiere TablePart getEmpfaenger() (zeige neues
// Versand-Datum)
GUI.startView(GUI.getCurrentView().getClass(),
GUI.getCurrentView().getCurrentObject());
EvalMail em = new EvalMail(empf);
if (erneutSenden || empf.getVersand() == null)
{
sender.sendMail(empf.getMailAdresse(), em.evalBetreff(betr),
em.evalText(txt), getMail().getAnhang());
sentCount++;
monitor.log(empf.getMailAdresse() + " - versendet");
// Nachricht wurde erfolgreich versendet; speicher Versand-Datum
// persistent.
empf.setVersand(new Timestamp(new Date().getTime()));
// Fix null value in colum mail for mailempfaenger
empf.setMail(getMail());
empf.store();
// aktualisiere TablePart getEmpfaenger() (zeige neues
// Versand-Datum)
GUI.startView(GUI.getCurrentView().getClass(),
GUI.getCurrentView().getCurrentObject());
}
else
{
monitor.log(empf.getMailAdresse() + " - �bersprungen");
}
}
else
catch (Exception e)
{
monitor.log(empf.getMailAdresse() + " - �bersprungen");
Logger.error("Fehler beim Mailversand", e);
monitor.log(empf.getMailAdresse() + " - " + e.getMessage());
}
zae++;
double proz = (double) zae
/ (double) getMail().getEmpfaenger().size() * 100d;
monitor.setPercentComplete((int) proz);

}
monitor.setPercentComplete(100);
monitor.setStatus(ProgressMonitor.STATUS_DONE);
Expand Down