class ExceptionHandlingMailSendingTemplate {

	public MessageSendStatus send(){

		final boolean useInstitutionalEmail = false; 
		final Emailer emailer = new Emailer(getFromIdentity(), useInstitutionalEmail, getMailTemplate());
		
		MessageSendStatus messageSendStatus = createSuccessfullSentEmailMessageStatus();
		boolean sendEmailSuccess = false;
		try {
			sendEmailSuccess = doSend(emailer);
		} catch (final AddressException e) {
			// error in recipient email address(es)
			// TODO:discuss: sendEmailSuccess should always be false if the addressexcpetion happens 
			messageSendStatus = handleAddressException(sendEmailSuccess);
		} catch (final SendFailedException e) {
			// error in sending message
			// CAUSE: sender email address invalid
			messageSendStatus = handleSendFailedException(e);
		} catch (final MessagingException e) {
			// error in message-subject || .-body
			messageSendStatus = handleMessagingException();
		}
		return messageSendStatus;
	}

}