* @param text
*/
public static void writeNetmail(FtnAddress from, FtnAddress to,
String fromName, String toName, String subject, String text,
int attr, boolean route) {
FtnMessage message = new FtnMessage();
StringBuilder sb = new StringBuilder();
sb.append(String.format("\001MSGID: %s %s\n\001PID: %s\n\001TID: %s\n",
from.toString(), generate8d(), MainHandler.getVersion(),
MainHandler.getVersion()));
sb.append(text);
sb.append("\n\n--- " + MainHandler.getVersion() + "\n");
message.setDate(new Date());
message.setToAddr(to);
message.setFromAddr(from);
message.setToName(toName);
message.setFromName(fromName);
message.setSubject(subject);
message.setText(sb.toString());
message.setNetmail(true);
message.setAttribute(attr);
processRewrite(message);
Link routeVia = null;
if (route) {
routeVia = getRouting(message);
if (routeVia == null) {