| .. | .. |
|---|
| 107 | 107 | builder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE); |
|---|
| 108 | 108 | builder.addTextBody("from", Params.get(Params.KEYS.EMAIL_FROM_ADDRESS)); |
|---|
| 109 | 109 | builder.addTextBody("to", to); |
|---|
| 110 | | - if (cc != null) |
|---|
| 110 | + if (cc != null) { |
|---|
| 111 | 111 | builder.addTextBody("cc", cc); |
|---|
| 112 | + } |
|---|
| 112 | 113 | builder.addTextBody("subject", subject, ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), Charset.forName("utf-8"))); |
|---|
| 113 | 114 | builder.addTextBody("text", body, ContentType.create(ContentType.TEXT_PLAIN.getMimeType(), Charset.forName("utf-8"))); |
|---|
| 114 | | - if (file != null) |
|---|
| 115 | + if (file != null) { |
|---|
| 116 | + |
|---|
| 117 | + LOG.info("File to attach: {}", file.getAbsoluteFile()); |
|---|
| 115 | 118 | builder.addPart("attachment", new FileBody(file)); |
|---|
| 119 | + } |
|---|
| 116 | 120 | |
|---|
| 117 | 121 | postRequest.setEntity(builder.build()); |
|---|
| 118 | 122 | HttpResponse response; |
|---|