IDEMPIERE-2182 - Allow many mail addresses with MAIL_SEND_BCC_TO_ADDRESS
This commit is contained in:
parent
5f571eabd7
commit
1ec73fb1fe
|
@ -314,7 +314,7 @@ public final class EMail implements Serializable
|
||||||
} else {
|
} else {
|
||||||
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
|
String bccAddressForAllMails = MSysConfig.getValue(MSysConfig.MAIL_SEND_BCC_TO_ADDRESS, Env.getAD_Client_ID(Env.getCtx()));
|
||||||
if (! Util.isEmpty(bccAddressForAllMails, true)) {
|
if (! Util.isEmpty(bccAddressForAllMails, true)) {
|
||||||
m_msg.setRecipient (Message.RecipientType.TO, new InternetAddress(bccAddressForAllMails, true));
|
m_msg.setRecipients (Message.RecipientType.TO, bccAddressForAllMails);
|
||||||
}
|
}
|
||||||
List<InternetAddress> replyToList=new ArrayList<InternetAddress>();
|
List<InternetAddress> replyToList=new ArrayList<InternetAddress>();
|
||||||
if(m_replyTo!=null)
|
if(m_replyTo!=null)
|
||||||
|
@ -697,19 +697,22 @@ public final class EMail implements Serializable
|
||||||
{
|
{
|
||||||
if (newBcc == null || newBcc.length() == 0)
|
if (newBcc == null || newBcc.length() == 0)
|
||||||
return false;
|
return false;
|
||||||
InternetAddress ia = null;
|
String[] addresses = newBcc.split(", *");
|
||||||
try
|
for (String bccAddress : addresses) {
|
||||||
{
|
InternetAddress ia = null;
|
||||||
ia = new InternetAddress (newBcc, true);
|
try
|
||||||
|
{
|
||||||
|
ia = new InternetAddress (bccAddress, true);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
log.log(Level.WARNING, bccAddress + ": " + e.getMessage());
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (m_bcc == null)
|
||||||
|
m_bcc = new ArrayList<InternetAddress>();
|
||||||
|
m_bcc.add (ia);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.log(Level.WARNING, newBcc + ": " + e.getMessage());
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (m_bcc == null)
|
|
||||||
m_bcc = new ArrayList<InternetAddress>();
|
|
||||||
m_bcc.add (ia);
|
|
||||||
return true;
|
return true;
|
||||||
} // addBcc
|
} // addBcc
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue