* Called when the send fails.
*/
public void sendFailed(OutgoingMailServer pMailServer, Exception e) {
sendLock=false;
Pooka.getUIFactory().clearStatus();
final OutgoingMailServer mailServer = pMailServer;
final Exception me = e;
final NewMessageUI nmui = getNewMessageUI();
if (nmui != null) {
Runnable runMe = new Runnable() {
public void run() {
if (me instanceof MessagingException) {
if (mailServer != null) {
SendFailedDialog sfd = getNewMessageUI().showSendFailedDialog(mailServer, (MessagingException) me);
if (sfd.resendMessage()) {
OutgoingMailServer newServer = sfd.getMailServer();
if (newServer != null) {
String action = sfd.getMailServerAction();
UserProfile profile = getNewMessageUI().getSelectedProfile();
if (action == SendFailedDialog.S_SESSION_DEFAULT) {
profile.setTemporaryMailServer(newServer);
} else if (action == SendFailedDialog.S_CHANGE_DEFAULT) {
Pooka.setProperty(profile.getUserProperty() + ".mailServer", newServer.getItemID());
}
newServer.sendMessage(getNewMessageInfo());
}
} else if (sfd.getSaveToOutbox()) {
try {
mailServer.saveToOutbox(getNewMessageInfo());
} catch (OperationCancelledException oce) {