Permalink
Browse files

Merge pull request #213 from corneil/master

Ensure that correct setters are used for cc and bcc map entries.
  • Loading branch information...
musketyr committed Oct 8, 2014
2 parents 4b73013 + 437865b commit 4513c42f87c2e777d695844a0991eb1228f9d5ed
Showing with 12 additions and 6 deletions.
  1. +12 −6 core/src/main/groovyx/gaelyk/extensions/MailExtensions.java
@@ -55,16 +55,22 @@
else throw new IllegalArgumentException("Headers must be collection of Header objects");
break;
case "to":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setTo((Collection<String>) v);
else
msg.setTo(String.valueOf(v));
break;
case "bcc":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setBcc((Collection<String>) v);
else
msg.setBcc(String.valueOf(v));
break;
case "cc":
if (v instanceof Collection<?>) msg.setTo((Collection<String>) v);
else msg.setTo(Arrays.asList(new String[] { String.valueOf(v) }));
if (v instanceof Collection<?>)
msg.setCc((Collection<String>) v);
else
msg.setCc(String.valueOf(v));
break;
case "from":
case "sender":

0 comments on commit 4513c42

Please sign in to comment.