PlainTextEmail.java from redshed at Krugle
Show PlainTextEmail.java syntax highlighted
// PlainTextEmail.java
//
// Copyright (c) 2002 Red Shed Software. All rights reserved.
// by Jonathan 'Wolf' Rentzsch (jon at redshed dot net)
//
// Wed Mar 20 2002 wolf: Created.
import com.webobjects.foundation.*;
import com.webobjects.appserver.*;
//import com.webobjects.eocontrol.*;
//import com.webobjects.eoaccess.*;
public class PlainTextEmail extends WOComponent {
public PlainTextEmail(WOContext context) {
super(context);
}
protected void sendPlainTextEmail( String fromEmailAddress, String toEmailAddress, String subject ) {
NSData contentData = generateResponse().content();
String contentString = new String( contentData.bytes( 0, contentData.length() ) );
contentString = HTML2PlainText.convert( contentString );
JRMailDelivery.sharedInstance().composePlainTextEmail( fromEmailAddress, new NSArray( toEmailAddress ), null, subject, contentString, true );
}
protected void sendComponentEmail( String fromEmailAddress, String toEmailAddress, String subject, WOComponent component, boolean sendNow ) {
NSData contentData = generateResponse().content();
String contentString = new String( contentData.bytes( 0, contentData.length() ) );
//contentString = HTML2PlainText.convert( contentString );
JRMailDelivery.sharedInstance().composeComponentEmail( fromEmailAddress, new NSArray( toEmailAddress ), null, subject, component, true );
}
}
See more files for this project here