Асинхронная рассылка.
This commit is contained in:
5
.idea/workspace.xml
generated
5
.idea/workspace.xml
generated
@@ -8,10 +8,7 @@
|
|||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/Json/SapforTasksResults_json.java" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Repository/RepositoryServer.java" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackage.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/SapforTestingSystem/SapforTasksPackage/SapforTasksPackageInterface.java" afterDir="false" />
|
|
||||||
<change beforePath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Visual_DVM_2021/UI/Main/SapforPackagesComparisonForm.java" afterDir="false" />
|
|
||||||
</list>
|
</list>
|
||||||
<option name="SHOW_DIALOG" value="false" />
|
<option name="SHOW_DIALOG" value="false" />
|
||||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||||
|
|||||||
@@ -82,7 +82,9 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Email(EmailMessage message_in, File... directAttachements) throws Exception {
|
public void Email(EmailMessage message_in, File... directAttachements) throws Exception {
|
||||||
System.out.println("EMAIL STARTED");
|
Thread thread = new Thread(() -> {
|
||||||
|
System.out.println("EMAIL THREAD STARTED");
|
||||||
|
try {
|
||||||
Properties props = new Properties();
|
Properties props = new Properties();
|
||||||
props.put("mail.smtp.host", Global.properties.SMTPHost);
|
props.put("mail.smtp.host", Global.properties.SMTPHost);
|
||||||
props.put("mail.smtp.auth", "true");
|
props.put("mail.smtp.auth", "true");
|
||||||
@@ -143,12 +145,18 @@ public abstract class RepositoryServer<D extends Database> {
|
|||||||
Transport.send(message);
|
Transport.send(message);
|
||||||
System.out.println("message sent");
|
System.out.println("message sent");
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
|
System.out.println("Исключение во время отправки сообщения абоненту " + Utils.Brackets(target));
|
||||||
ex.printStackTrace();
|
ex.printStackTrace();
|
||||||
Print(ex.getMessage());
|
|
||||||
}
|
}
|
||||||
} else System.out.println("does not need email");
|
} else System.out.println("does not need email");
|
||||||
}
|
}
|
||||||
System.out.println("EMAIL ENDED");
|
} catch (Exception ex) {
|
||||||
|
System.out.println("Исключение во время выполнения рассылки.");
|
||||||
|
ex.printStackTrace();
|
||||||
|
}
|
||||||
|
System.out.println("EMAIL THREAD ENDED");
|
||||||
|
});
|
||||||
|
thread.start();
|
||||||
}
|
}
|
||||||
public boolean needsEmail(String email) {
|
public boolean needsEmail(String email) {
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
Reference in New Issue
Block a user