@Action(name = "Send Mail",
            outputs = {
                    @Output(RETURN_RESULT),
                    @Output(RETURN_CODE),
                    @Output(EXCEPTION)
            },
            responses = {
                    @Response(text = SUCCESS, field = RETURN_CODE, value = SUCCESS_RETURN_CODE,
                            matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.RESOLVED),
                    @Response(text = FAILURE, field = RETURN_CODE, value = FAILURE_RETURN_CODE,
                            matchType = MatchType.COMPARE_EQUAL, responseType = ResponseType.ERROR)
            }
        )
    public Map<String, String> execute(
            @Param(value = HOSTNAME, required = true) String hostname,
            @Param(value = PORT, required = true) String port,
            @Param(value = HTML_EMAIL) String htmlEmail,
            @Param(value = FROM, required = true) String from,
            @Param(value = TO, required = true) String to,
            @Param(CC) String cc,
            @Param(BCC) String bcc,
            @Param(value = SUBJECT, required = true) String subject,
            @Param(value = BODY, required = true) String body,
            @Param(READ_RECEIPT) String readReceipt,
            @Param(ATTACHMENTS) String attachments,
            @Param(HEADERS) String headers,
            @Param(HEADERS_ROW_DELIMITER) String rowDelimiter,
            @Param(HEADERS_COLUMN_DELIMITER) String columnDelimiter,
            @Param(USER) String user,
            @Param(PASSWORD) String password,
            @Param(DELIMITER) String delimiter,
            @Param(CHARACTERSET) String characterSet,
            @Param(CONTENT_TRANSFER_ENCODING) String contentTransferEncoding,
            @Param(ENCRYPTION_KEYSTORE) String encryptionKeystore,
            @Param(ENCRYPTION_KEY_ALIAS) String encryptionKeyAlias,
            @Param(ENCRYPTION_KEYSTORE_PASSWORD) String encryptionKeystorePassword,
            @Param(ENABLE_TLS) String enableTLS,
            @Param(TIMEOUT) String timeout,
            @Param(ENCRYPTION_ALGORITHM) String encryptionAlgorithm
    ) throws Exception {

        SendMailInputs sendMailInputs = new SendMailInputs();
        sendMailInputs.setSmtpHostname(hostname);
        sendMailInputs.setPort(port);
        sendMailInputs.setHtmlEmail(htmlEmail);
        sendMailInputs.setFrom(from);
        sendMailInputs.setTo(to);
        sendMailInputs.setCc(cc);
        sendMailInputs.setBcc(bcc);
        sendMailInputs.setSubject(subject);
        sendMailInputs.setBody(body);
        sendMailInputs.setReadReceipt(readReceipt);
        sendMailInputs.setAttachments(attachments);
        sendMailInputs.setHeaders(headers);
        sendMailInputs.setRowDelimiter(rowDelimiter);
        sendMailInputs.setColumnDelimiter(columnDelimiter);
        sendMailInputs.setUser(user);
        sendMailInputs.setPassword(password);
        sendMailInputs.setDelimiter(delimiter);
        sendMailInputs.setCharacterset(characterSet);
        sendMailInputs.setContentTransferEncoding(contentTransferEncoding);
        sendMailInputs.setEncryptionKeystore(encryptionKeystore);
        sendMailInputs.setEncryptionKeyAlias(encryptionKeyAlias);
        sendMailInputs.setEncryptionKeystorePassword(encryptionKeystorePassword);
        sendMailInputs.setEnableTLS(enableTLS);
        sendMailInputs.setTimeout(timeout);
        sendMailInputs.setEncryptionAlgorithm(encryptionAlgorithm);

        try {
            return new SendMail().execute(sendMailInputs);
        } catch (Exception e) {
            return exceptionResult(e.getMessage(), e);
        }
    }
@ Action ( name = "Send Mail" , outputs = { @ Output ( RETURN_RESULT ) , @ Output ( RETURN_CODE ) , @ Output ( EXCEPTION ) } , responses = { @ Response ( text = SUCCESS , field = RETURN_CODE , value = SUCCESS_RETURN_CODE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . RESOLVED ) , @ Response ( text = FAILURE , field = RETURN_CODE , value = FAILURE_RETURN_CODE , matchType = MatchType . COMPARE_EQUAL , responseType = ResponseType . ERROR ) } ) public Map < String , String > execute ( @ Param ( value = HOSTNAME , required = true ) String hostname , @ Param ( value = PORT , required = true ) String port , @ Param ( value = HTML_EMAIL ) String htmlEmail , @ Param ( value = FROM , required = true ) String from , @ Param ( value = TO , required = true ) String to , @ Param ( CC ) String cc , @ Param ( BCC ) String bcc , @ Param ( value = SUBJECT , required = true ) String subject , @ Param ( value = BODY , required = true ) String body , @ Param ( READ_RECEIPT ) String readReceipt , @ Param ( ATTACHMENTS ) String attachments , @ Param ( HEADERS ) String headers , @ Param ( HEADERS_ROW_DELIMITER ) String rowDelimiter , @ Param ( HEADERS_COLUMN_DELIMITER ) String columnDelimiter , @ Param ( USER ) String user , @ Param ( PASSWORD ) String password , @ Param ( DELIMITER ) String delimiter , @ Param ( CHARACTERSET ) String characterSet , @ Param ( CONTENT_TRANSFER_ENCODING ) String contentTransferEncoding , @ Param ( ENCRYPTION_KEYSTORE ) String encryptionKeystore , @ Param ( ENCRYPTION_KEY_ALIAS ) String encryptionKeyAlias , @ Param ( ENCRYPTION_KEYSTORE_PASSWORD ) String encryptionKeystorePassword , @ Param ( ENABLE_TLS ) String enableTLS , @ Param ( TIMEOUT ) String timeout , @ Param ( ENCRYPTION_ALGORITHM ) String encryptionAlgorithm ) throws Exception { SendMailInputs sendMailInputs = new SendMailInputs ( ) ; sendMailInputs . setSmtpHostname ( hostname ) ; sendMailInputs . setPort ( port ) ; sendMailInputs . setHtmlEmail ( htmlEmail ) ; sendMailInputs . setFrom ( from ) ; sendMailInputs . setTo ( to ) ; sendMailInputs . setCc ( cc ) ; sendMailInputs . setBcc ( bcc ) ; sendMailInputs . setSubject ( subject ) ; sendMailInputs . setBody ( body ) ; sendMailInputs . setReadReceipt ( readReceipt ) ; sendMailInputs . setAttachments ( attachments ) ; sendMailInputs . setHeaders ( headers ) ; sendMailInputs . setRowDelimiter ( rowDelimiter ) ; sendMailInputs . setColumnDelimiter ( columnDelimiter ) ; sendMailInputs . setUser ( user ) ; sendMailInputs . setPassword ( password ) ; sendMailInputs . setDelimiter ( delimiter ) ; sendMailInputs . setCharacterset ( characterSet ) ; sendMailInputs . setContentTransferEncoding ( contentTransferEncoding ) ; sendMailInputs . setEncryptionKeystore ( encryptionKeystore ) ; sendMailInputs . setEncryptionKeyAlias ( encryptionKeyAlias ) ; sendMailInputs . setEncryptionKeystorePassword ( encryptionKeystorePassword ) ; sendMailInputs . setEnableTLS ( enableTLS ) ; sendMailInputs . setTimeout ( timeout ) ; sendMailInputs . setEncryptionAlgorithm ( encryptionAlgorithm ) ; try { return new SendMail ( ) . execute ( sendMailInputs ) ; } catch ( Exception e ) { return exceptionResult ( e . getMessage ( ) , e ) ; } }
The operation sends a smtp email.

@param hostname The hostname or ip address of the smtp server.
@param port The port of the smtp service.
@param htmlEmail The value should be true if the email is in rich text/html format.
The value should be false if the email is in plain text format.
Valid values: true, false. Default value: true.
@param from From email address.
@param to A delimiter separated list of email address(es) or recipients where the email will be sent.
@param cc A delimiter separated list of email address(es) or recipients, to be placed in the CC.
@param bcc A delimiter separated list of email address(es) or recipients, to be placed in the BCC.
@param subject The email subject. If a subject spans on multiple lines, it is formatted to a single one.
@param body The body of the email.
@param readReceipt The value should be true if read receipt is required, else false.
Valid values: true, false.
Default value: false.
@param attachments A delimited separated list of files to attach (must be full path).
@param user If SMTP authentication is needed, the username to use.
@param password If SMTP authentication is needed, the password to use.
@param delimiter A delimiter to separate the email recipients and the attachments. Default value: ','.
@param characterSet The character set encoding for the entire email which includes subject, body,
attached file name and the attached file.
<br>Valid values: UTF-8, UTF-16, UTF-32, EUC-JP, ISO-2022-JP, Shift_JIS, Windows-31J.
Default value: UTF-8.
@param contentTransferEncoding The content transfer encoding scheme (such as 7bit, 8bit, base64, quoted-printable
etc) for the entire email which includes subject, body, attached file name and the
attached file.
Valid values: quoted-printable, base64, 7bit, 8bit, binary, x-token.
Default value: quoted-printable (or Q Encoding).
@param encryptionKeystore The path to the pks12 format keystore to use to encrypt the mail.
@param encryptionKeyAlias The alias of the key from the encryptionKeystore to use to encrypt the mail.
@param encryptionKeystorePassword The password for the encryptionKeystore.
@param timeout The timeout (seconds) for sending the mail messages.
@return a map containing the output of the operation. The keys present in the map are
<br><b>returnResult</b> - that will contain the SentMailSuccessfully if the mail was sent successfully.
<br><b>returnCode</b> - the return code of the operation. 0 if the operation goes to success, -1 if the
operation goes to failure.
<br><b>exception</b> - the exception message if the operation goes to failure.
@throws Exception