commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Davey <>
Subject [email] SimpleEmail
Date Sun, 03 Aug 2003 11:40:27 GMT

Ant has a MailMessage class that can be used like this:

// ----%<----
MailMessage msg = new MailMessage(mailhost, mailport);
msg.from("Ant Mail Message <>");"");
msg.setSubject("Test subject");

PrintStream out = msg.getPrintStream();
out.println( "test message line 1" );
out.println( "test message line 2" );

// ----%<----

The important bit here is the out.println(). Perhaps something could be 
added to SimpleEmail to allow the message body to be built up line by 
line. Either a getPrintStream() method or perhaps an addMsg() method?

Also, I feel that there is scope within commons-email for a mail class 
that doesn't use JavaMail and performs a "best-efforts" mail delivery. 
 Indeed, this is pretty much what Ant's MailMessage class does.


View raw message