order_params.set_var("mail_send_at", message.getSentDateAsString());
if (mailSchedulerHost.equals(spooler.hostname()) && mailSchedulerPort == spooler.tcp_port()) {
sosLogger.debug3("...host/port is this host and port. Using API");
Job_chain j = spooler.job_chain(jobchain);
sosLogger.debug3("...jobchain " + jobchain + " created.");
Order o = spooler.create_order();
o.params().merge(order_params);
// if (!id.equals(""))o.set_id(id);
sosLogger.debug3("...order " + o.id() + " created.");
if (!state.equals(""))
o.set_state(state);
if (!title.equals(""))
o.set_title(title);
j.add_order(o);
sosLogger.debug3("...order added to " + jobchain);
}
else {
startOrderXML(host_, port_, jobchain, id, state, title, order_params);