1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package org.apache.commons.mail;
17
18 /***
19 * This class is used to send simple internet email messages without
20 * attachments.
21 *
22 * @since 1.0
23 * @author <a href="mailto:quintonm@bellsouth.net">Quinton McCombs</a>
24 * @author <a href="mailto:colin.chalmers@maxware.nl">Colin Chalmers</a>
25 * @author <a href="mailto:jon@latchkey.com">Jon S. Stevens</a>
26 * @author <a href="mailto:frank.kim@clearink.com">Frank Y. Kim</a>
27 * @author <a href="mailto:bmclaugh@algx.net">Brett McLaughlin</a>
28 * @author <a href="mailto:unknown">Regis Koenig</a>
29 * @version $Id: SimpleEmail.java 279285 2005-09-07 09:52:44Z henning $
30 */
31 public class SimpleEmail extends Email
32 {
33 /***
34 * Set the content of the mail
35 *
36 * @param msg A String.
37 * @return An Email.
38 * @throws EmailException see javax.mail.internet.MimeBodyPart
39 * for definitions
40 * @since 1.0
41 */
42 public Email setMsg(String msg) throws EmailException
43 {
44 if (EmailUtils.isEmpty(msg))
45 {
46 throw new EmailException("Invalid message supplied");
47 }
48
49 setContent(msg, TEXT_PLAIN);
50 return this;
51 }
52 }