/* Copyright 2013 Nationale-Nederlanden Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package nl.nn.adapterframework.pipes; import nl.nn.adapterframework.senders.MailSender; /** * Pipe that sends a mail-message using a {@link MailSender} as its sender. * <br/> * Sample email.xml:<br/><code><pre> * <email> * <recipients> * <recipient>***@natned</recipient> * <recipient>***@nn.nl</recipient> * </recipients> * <from>***@nn.nl</from> * <subject>this is the subject</subject> * <message>dit is de message</message> * </email> * </pre></code> <br/> * Notice: it must be valid XML. Therefore, especially the message element * must be plain text or be wrapped as CDATA.<br/><br/> * example:<br/><code><pre> * <message><![CDATA[<h1>This is a HtmlMessage</h1>]]></message> * </pre></code><br/> * * <p><b>Configuration:</b> * <table border="1"> * <tr><th>attributes</th><th>description</th><th>default</th></tr> * <tr><td>{@link #setForwardName(String) forwardName}</td><td>name of forward returned upon completion</td><td>"success"</td></tr> * <tr><td>{@link MailSender#setSmtpHost(String) sender.smtpHost}</td><td>name of the host by which the messages are to be send</td><td> </td></tr> * <tr><td>{@link MailSender#setSmtpUserid(String) sender.smtpUserid}</td><td>userid on the smtpHost</td><td> </td></tr> * <tr><td>{@link MailSender#setSmtpPassword(String) sender.smtpPassword}</td><td>password of userid on the smtpHost</td><td> </td></tr> * <tr><td>{@link MailSender#setDefaultFrom(String) sender.defaultFrom}</td><td>value of the From: header if not specified in message itself</td><td> </td></tr> * <tr><td>{@link MailSender#setDefaultSubject(String) sender.defaultSubject}</td><td>value of the Subject: header if not specified in message itself</td><td> </td></tr> * </table> * </p> * <table border="1"> * <tr><th>nested elements</th><th>description</th></tr> * <tr><td>{@link nl.nn.adapterframework.core.ICorrelatedPullingListener listener}</td><td>specification of a listener to listen to for replies, assuming these to arrive quickly!</td></tr> * </table> * </p> * <p><b>Exits:</b> * <table border="1"> * <tr><th>state</th><th>condition</th></tr> * <tr><td>"success"</td><td>default when the message was successfully sent and no listener was specified</td></tr> * <tr><td><i>{@link #setForwardName(String) forwardName}</i></td><td>if specified, and otherwise under same condition as "success"</td></tr> * <tr><td>"timeout"</td><td>no data was received (timeout on listening), if a listener was specified.</td></tr> * </table> * </p> * @author Johan Verrips */ public class MailSenderPipe extends MessageSendingPipe { public MailSenderPipe() { super(); setSender(new MailSender()); } }