1 /* 2 * Copyright 2002-2005 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 17 package org.springframework.mail; 18 19 import java.util.Date; 20 21 /** 22 * This is a common interface for mail messages, allowing a user to set key 23 * values required in assembling a mail message, without needing to know if 24 * the underlying message is a simple text message or a more sophisticated 25 * MIME message. 26 * 27 * <p>Implemented by both SimpleMailMessage and MimeMessageHelper, 28 * to let message population code interact with a simple message or a 29 * MIME message through a common interface. 30 * 31 * @author Juergen Hoeller 32 * @since 1.1.5 33 * @see SimpleMailMessage 34 * @see org.springframework.mail.javamail.MimeMessageHelper 35 */ 36 public interface MailMessage { 37 38 public void setFrom(String from) throws MailParseException; 39 40 public void setReplyTo(String replyTo) throws MailParseException; 41 42 public void setTo(String to) throws MailParseException; 43 44 public void setTo(String[] to) throws MailParseException; 45 46 public void setCc(String cc) throws MailParseException; 47 48 public void setCc(String[] cc) throws MailParseException; 49 50 public void setBcc(String bcc) throws MailParseException; 51 52 public void setBcc(String[] bcc) throws MailParseException; 53 54 public void setSentDate(Date sentDate) throws MailParseException; 55 56 public void setSubject(String subject) throws MailParseException; 57 58 public void setText(String text) throws MailParseException; 59 60 } 61