Skip to content

Commit 9141d90

Browse files
committed
Merge pull request #19 from rtyley/send-plain-text-email
Send simple, single part, text/plain e-mail rather than multi-part
2 parents 4b3c1ed + 94f8243 commit 9141d90

File tree

1 file changed

+1
-10
lines changed

1 file changed

+1
-10
lines changed

app/lib/Email.scala

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,21 +50,12 @@ case class Email(
5050
headers.foreach(t => msg.addHeader(t._1, t._2))
5151
addresses.replyTo.foreach(r => msg.setReplyTo(Array(new InternetAddress(r))))
5252

53-
// Add a MIME part to the message
54-
val mp = new MimeMultipart()
55-
56-
val part = new MimeBodyPart()
57-
part.setContent(bodyText, "text/plain")
58-
mp.addBodyPart(part)
59-
60-
msg.setContent(mp)
53+
msg.setText(bodyText)
6154

6255
val b = new ByteArrayOutputStream()
6356

6457
msg.writeTo(b)
6558

66-
msg.writeTo(System.out);
67-
6859
ByteBuffer.wrap(b.toByteArray)
6960

7061
}

0 commit comments

Comments
 (0)