public GenericResult send()

in server/src/main/java/org/apache/hupa/server/service/SendMessageBaseServiceImpl.java [78:107]


    public GenericResult send(SendMessageAction action)
            throws Exception {
        GenericResult result = new GenericResultImpl();
        try {
            User user = getUser();
            Message message = createMessage(cache.getMailSession(user), action);
            message = fillBody(message,action);
            sendMessage(getUser(), message);
            if (!user.getSettings().getSmtpServer().contains("gmail.com")) {
                saveSentMessage(getUser(), message);
            }
            resetAttachments(action);

            // TODO: notify the user more accurately where the error is
            // if the message was sent and the storage in the sent folder failed, etc.
        } catch (AddressException e) {
            result.setError("Error while parsing recipient: " + e.getMessage());
            logger.error("Error while parsing recipient", e);
        } catch (AuthenticationFailedException e) {
            result.setError("Error while sending message: SMTP Authentication error.");
            logger.error("SMTP Authentication error", e);
        } catch (MessagingException e) {
            result.setError("Error while sending message: " + e.getMessage());
            logger.error("Error while sending message", e);
        } catch (Exception e) {
            result.setError("Unexpected exception while sendig message: " + e.getMessage());
            logger.error("Unexpected exception while sendig message: ", e);
        }
        return result;
    }