1. /*
  2. * Copyright 2002-2004 the original author or authors.
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. package org.springframework.mail;
  17. /**
  18. * This interface defines a strategy for sending simple mails. Can be
  19. * implemented for a variety of mailing systems due to the simple requirements.
  20. * For richer functionality like MIME messages, consider JavaMailSender.
  21. *
  22. * <p>Allows for easy testing of clients, as it does not depend on JavaMail's
  23. * infrastructure classes: no mocking of JavaMail Session or Transport necessary.
  24. *
  25. * @author Dmitriy Kopylenko
  26. * @author Juergen Hoeller
  27. * @since 10.09.2003
  28. * @see org.springframework.mail.javamail.JavaMailSender
  29. * @version $Id: MailSender.java,v 1.6 2004/03/18 02:46:05 trisberg Exp $
  30. */
  31. public interface MailSender {
  32. /**
  33. * Send the given simple mail message.
  34. * @param simpleMessage message to send
  35. * @throws MailException in case of message, authentication or send errors
  36. */
  37. void send(SimpleMailMessage simpleMessage) throws MailException;
  38. /**
  39. * Send the given array of simple mail messages in batch.
  40. * @param simpleMessages messages to send
  41. * @throws MailException in case of message, authentication or send errors
  42. */
  43. void send(SimpleMailMessage[] simpleMessages) throws MailException;
  44. }