выписка адресатов при рассылке
This commit is contained in:
@@ -109,6 +109,19 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
targets_.add(Constants.MailAddress); //себе.
|
||||
targets_.addAll(message_in.targets);
|
||||
//------------------------------
|
||||
Vector<String> targetsNames = new Vector<>();
|
||||
for (String target: targets_){
|
||||
String [] data = target.split("@");
|
||||
if (data.length>0) {
|
||||
String tname = data[0];
|
||||
targetsNames.add(tname);
|
||||
}
|
||||
}
|
||||
String text_ =
|
||||
"Адресаты: "+String.join(", ",targetsNames)+"\n"+
|
||||
message_in.text
|
||||
;
|
||||
//------------------------------
|
||||
Session session = Session.getDefaultInstance(props,
|
||||
new Authenticator() {
|
||||
@Override
|
||||
@@ -118,6 +131,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
Constants.MailPassword);
|
||||
}
|
||||
});
|
||||
|
||||
for (String target : targets_) {
|
||||
boolean done = false;
|
||||
int attempts = 5;
|
||||
@@ -129,7 +143,7 @@ public abstract class RepositoryServer<D extends Database> {
|
||||
message.setSubject(message_in.subject);
|
||||
Multipart multipart = new MimeMultipart();
|
||||
MimeBodyPart textBodyPart = new MimeBodyPart();
|
||||
textBodyPart.setText(message_in.text);
|
||||
textBodyPart.setText(text_);
|
||||
multipart.addBodyPart(textBodyPart);
|
||||
for (String aName : innerFiles.keySet()) {
|
||||
MimeBodyPart attachmentBodyPart = new MimeBodyPart();
|
||||
|
||||
Reference in New Issue
Block a user