All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.phloc.web.smtp.IEmailData Maven / Gradle / Ivy

/**
 * Copyright (C) 2006-2015 phloc systems
 * http://www.phloc.com
 * office[at]phloc[dot]com
 *
 * 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 com.phloc.web.smtp;

import java.util.List;
import java.util.Map;

import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.joda.time.DateTime;

import com.phloc.commons.annotations.Nonempty;
import com.phloc.commons.collections.attrs.IAttributeContainer;
import com.phloc.commons.email.IEmailAddress;

/**
 * Contains all possible fields for mail sending.
* Note: the attribute container may only contain String values! * * @author Philip Helger */ public interface IEmailData extends IReadonlyEmailData, IAttributeContainer { @Nonnull IEmailData setEmailType (@Nonnull EEmailType eType); @Nonnull IEmailData setFrom (@Nullable IEmailAddress aFrom); @Nonnull IEmailData setReplyTo (@Nullable IEmailAddress aReplyTo); @Nonnull IEmailData setReplyTo (@Nullable IEmailAddress... aTo); @Nonnull IEmailData setReplyTo (@Nullable List aTo); @Nonnull IEmailData setTo (@Nullable IEmailAddress aTo); @Nonnull IEmailData setTo (@Nullable IEmailAddress... aTo); @Nonnull IEmailData setTo (@Nullable List aTo); @Nonnull IEmailData setCc (@Nullable IEmailAddress aCc); @Nonnull IEmailData setCc (@Nullable IEmailAddress... aCc); @Nonnull IEmailData setCc (@Nullable List aCc); @Nonnull IEmailData setBcc (@Nullable IEmailAddress aBcc); @Nonnull IEmailData setBcc (@Nullable IEmailAddress... aBcc); @Nonnull IEmailData setBcc (@Nullable List aBcc); @Nonnull IEmailData setSentDate (@Nullable DateTime aDate); @Nonnull IEmailData setSubject (@Nullable String sSubject); @Nonnull IEmailData setBody (@Nullable String sBody); @Override @Nullable IEmailAttachmentList getAttachments (); IEmailData setHeader (@Nonnull @Nonempty final String sHeader, @Nonnull @Nonempty final String sValue); Map getHeaders (); /** * @return The number of contained attachments. Always ≥ 0. */ @Nonnegative int getAttachmentCount (); /** * Specify a set of attachments to be send together with the mail. Pass * null to indicate that no attachments are desired (this is the * default). * * @param aAttachments * The attachments to be used. May be null or empty. * @return this */ @Nonnull IEmailData setAttachments (@Nullable IEmailAttachmentList aAttachments); boolean isUseFailedMailQueue (); IEmailData setUseFailedMailQueue (final boolean bUseFailedMailQueue); }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy